Script Roll Dice


#1

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


#2

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

also moved to #development:scripts


#3

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


#4

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)

#5

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