[RELEASE] Dice Roller

I noticed that there were no dice rolling scripts available so a good friend of mine (ZacFierce) helped me write a dice rolling script from scratch which allows you to roll dice with however many sides you want however many times you want. we also utilize 3dme (can be found at [Release] /me but the text is 3D printed) to have the text pop up above the player who rolled. The way to use the script is “/roll [sides on the die] [how many dice]” so for instance /roll 6 3 would roll 3 six sided dice.

The script can be found at https://github.com/mrfunbeard/zffb_dice and anyone can feel free to use it and make edits and everything as long as credit is given.

The only dependency is:
3dme (link is above)

Nothing else is required:)

Thank you @ZacFierce (not a fivem player just a close friend of mine who is a game developer)as well as Elio for 3dme which really brought this all together.
I also just want to add in that I appreciate this great community that offers help to people like me who are new to scripting. You all are a great help and I appreciate all of you. I hope this script is found useful for someone :smiley:

10 Likes

Unique Script, thanks for this!

oh let me also add in a warning, do not roll dice with millions of sides millions of times. That is something the script doesn’t like. but luckily it only crashes the person who does it so :stuck_out_tongue: don’t a crazy big deal as long as its used realistically

works for vrp?

or just esx?

It doesn’t require anything. Not everything is “esx” or “vrp”.

Simple script but good job OP

1 Like

Can you add id in the chat who is rolling it?

1 Like

I originally had that in and it showed up as the steam name. I couldn’t figure out the correct way to pull the RP name so I left it out. If I figure it out I will for sure re-release (edit): it does pop up above the person who rolled and only pops up in chat locally.

1 Like

Thank you, that means a lot coming from you. It’s the first script I’ve worked on that is completely custom and it feels good to give back and help out with what I’ve learned from such a giving and great community.

1 Like

I don’t think you can get the RP name without making it to ESX or VRP. Fine work. Glad to see some new dev faces around :smile:

1 Like

Nice copy of NoPixel dice roll script.

1 Like

I can change the tag if I need to, I just don’t know what else you would use it for😜

1 Like

Since most of the time people are rolling dice gambling… have you put any thought into allowing a player to start a dice group roll. Anyone that wants in and is near press E and then the script goes in order to who pressed in to tell them to roll and pays out the winner. So you don’t have situations where someone wants to roll for $1000 but only has $1 in cash :smiley:

It is something I have been thinking about but since you have most of the code done … using server script to network anyone in game shouldn’t be that hard.

SpikE

2 Likes

Yes I will look into adding that. I feel like that would be a great addition

What can you do for the entire server ? I mean it will automatically !

1 Like

bạn có nó chứ ?
I mean( press E and then the script goes in order to who pressed in to tell them to roll and pays out the winner !)

This was a option i gave as a suggestion to the creator. Not sure much progress he has made in making it server sided.

1 Like

ill get working on it shortly. I apologize. have had lots coming up personally lately. I really do want to add that in because I think itll make a great addition

Is there anyway to instead of adding up the dice rolls to display the results of each roll individually?

would give a lot of numbers on screen for bigger rolls. the way it is allows for a variety of dice to be rolled

Right but lets say I roll a 69 sided dice 5 times instead of getting the random numbers between 1-69 then adding them, im suggesting (maybe even make it a config option) to display the results of the roles individually like 3/69 52/69/ 14/69 32/69 24/69 as an example, then you can see the results of each roll. Obviously if you do a lot of rolls it would be a lot to display but I think its could have more RP potential to show each roll individually.

Alternatively if you didnt want to put it in your code do you have any idea how I could alter it to display in that way?