Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How would you make a random tool giver like the one in murder mystery?

Asked by 10 years ago

Like in murder mystery the way the "Murder" Gets a knife , "Sherrif" Gets a gun, And Innocents get nothing at all

1 answer

Log in to vote
0
Answered by 10 years ago

HOW you would do this all depends on the route your ideal logic takes when you decide to code it. Specifically in murder mystery he uses a mathematical code like in most overall game scripts where it assigns every person a certain percentage of the 100% chance of getting a tool. He uses probably the math.random() function to choose a number, lets say he initialized it for 1 through 100, and the more percentage you had, the better chance your number was chosen. In between all the lines of my explanation is just basic logic statements like you could probably get away with building the script from if statements.

Beyond the outlining mathematical script, it would also require a function or a statement to give the person the tool from a stored location, and put it into their backpack.

I hope this helps for getting through the logic of it, so you can take the initiative and build the script yourself! If you have any questions, feel free to ask.

Ad

Answer this question