[STANDALONE] RollDice by SpecialStos - (Works with/without OneSync)


An optimised and standalone RollDice system for FiveM.

DISCLAIMER

You are not allowed to sell or take credit of this script by any means, this is a free script just for the general FiveM population. You are allowed to do any changes you want, for yourself.

YOUTUBE IN-DEPTH SHOWCASE:

Dependencies and Compatibility:

Expand

Framework Dependencies
none (This can be standalone or work with ANY framework)

Sql Resource Dependencies

none

Resource Dependencies

none

Locales/Translations

none

OneSync Compatibility
:white_check_mark:

Non-OneSync Compatibility
:white_check_mark:

Config:

Expand
RollDice = {}

RollDice.UseCommand = true --Use command or not.
RollDice.ChatCommand = "roll" --Command name.
RollDice.ChatPrefix = "SYSTEM" --This is the chat prefix. If they type a wrong number or invalid one then it will say that SYSTEM has messaged them, just try it.
RollDice.ChatTemplate = "error" --YOU SHOULD CHANGE THIS HERE. I don't really know what chat themes you got so change it. We made our own ones, like error, warning, etc. You can find out what themes you got by checking inside the chat resource in index.css

RollDice.MaxDices = 2 -- Max amount of dices you can roll at one instance. Default is 2.
RollDice.MaxSides = 6 -- Max amount of sides on a dice. Default is 6.
RollDice.MaxDistance = 7.0 -- Distance players can see the rolldice in 3d text.
RollDice.ShowTime = 7 -- Time in seconds on how long the players can see the RollDice.
RollDice.Offset = 1.2 --Changes the z axis of the 3d text displayed.

GitHub - Click Me

4 Likes

Very cool! Been looking for something like this! Thanks! Great release!

This is great! How much ms does it take?

Thanks for the good words mate! :slight_smile:

Hey there,

at the moment it idles at 0.01 ms. When the 3d text shows up for the 6-7 seconds it can catch up to 0.06ms. You can really avoid that though, best option is to not use 3d text as that is what takes a lot of ms, constantly spamming that 3d text with natives. I would recommend making it with chat or making an NUI script. :slight_smile:

Best regards,
SpecialStos

1 Like

This is amazing, thank you for sharing it

You need to check if sides and dices are nil after attempting to convert them tonumber, rather than just checking if args[1] and args[2] are nil. Someone can send Rolldice Notanumber alsonotanumber and it error server side

1 Like

Hey man,

yes i probably forgot about it as i did this resource in like 30 minutes or so. Will add an update on Github.

Thanks for letting me know. :heart:

For sure, if edits/prs didn’t fork the repo I would push one. I’m lazy and don’t like sifting through my repos for stuff I need.