Script Roll Dice

Hello everyone !

I’m looking for a dice roll script. Or an idea how to do it.
The objectif would be with a chatcommand like / rolldice make a dice roll in chatbox for near players

Sorry for my English, I am French! :blush:
Thank you
Witch

1 Like

Simply use math.random(num) to choose a random number then send a message in chat

also moved to #development:scripts

2 Likes

math.random(lower, upper) creates a random number between lower and upper.

1 Like

http://illusivetea.me/WhyIsThereSoManyFuckingRpServers/0oa60v15F.png

This should do the trick. But please use it to learn, not to just copy and paste and forget about it

RegisterCommand("rolldice", function() 
	num = math.random(1,6)
	TriggerEvent("chatMessage", "Dice Gods", {255,0,0}, "You rolled a ^2"..num)
end, false)
4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.