Jump to content

100-sided Dice Script


Bolkral Steerpike
 Share

You are about to reply to a thread that has been inactive for 3554 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I've seen some other assistance here before, but to ensure I properly understand, I thought I would ask again. I am trying to create a relatively simple dice script that will use modifiers, and roll a 100-sided dice randomly.

All the script really needs to do is to randomly generate the number, so long as it won't also generate a 0 - as a 0 wouldn't make sense for the games in which the dice would be used, and say whom rolled it in local chat. (eg. "<player name> has rolled a 54.")

 

Can anyone help? Thanks a lots :)

Link to comment
Share on other sites

Thanks so much for the help! I really appreciate it. Though I do have a question!

 

If on touch I wanted it to say <sim name> <player name> rolled a <dice number>, how would I modify the script?

 

Would it just be:

 

default{  state_entry() {}  touch_start(integer num)  {     string player = llGetDisplayName(llDetectedKey(0));     integer roll = (integer)(llFrand(100.0)+1);     llSay(0, "sim name" + player + " rolled a " + (string)roll);  }}
Link to comment
Share on other sites

  • 1 year later...


mischief Goldshark wrote:

@ron: i could but i am anti-display names with stupid characters you cant read, so never use them in scripts
;)

I really would advise you to reconsider that.   All accounts created in the last two or three years have the new style names, and most of the users hate them, particularly now it's getting harder and harder to find a sensible sounding one that's not been taken.   I certainly dislike seeing scripted objects chatting about Joe123 Resident.

I've used llGetDispayName(id) almost since it came out, on the argument that if people have bothered to set a display name, it's probably what they want to be called, and people seem to like it.   My impression is that, while we obviously notice and remember the stupid unicode confections, the great majority of display names I see, both on sims and in busy groups, are sensible enough. 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3554 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...