Tabletop Simulator

Tabletop Simulator

Scripted Dice Roller 2.0
16 Comments
VitMercury 27 Apr, 2020 @ 12:54pm 
Hey, i tweaked this roller a bit, here are the key changes -
1) Made dice selection buttons respect LMB/RMB (increment/decrement)
2) Made memory buttons display the remembered dice on the dice selection buttons after use
3) Removed a forced reset after every dice roll
4) Removed mod+/- buttons
5) Made mod selection buttons respect LMB/RMB (increment/decrement)
6) Mod is no longer saved into memory, and instead the current mod values are used
(to enable adding mods to generic dice combinations)

I'l upload soon, will give proper credit to you & stump, thanks for a good utility!
Quizzelbuck 18 Apr, 2020 @ 5:09pm 
@pigneedle thanks for a straight answer.
pigneedle  [author] 17 Apr, 2020 @ 7:46pm 
I am building a new roller but if you have suggestions, I will listen.
theunending 17 Apr, 2020 @ 5:23pm 
hey pigneedle just noticed this was updated and i first wanted to say thank you!!! (i use so many of your mods) secondly it recently occurred to me as i was updating my rollers to the newer randomization code that ive made some changes overtime mostly consistency and QoL changes that you may be interested in. if not thats fine if you are just let me know how you want it raw code or a workshop upload ect ect
pigneedle  [author] 12 Apr, 2020 @ 6:33pm 
@Quizzelbuck Not without some script editing.
Quizzelbuck 12 Apr, 2020 @ 12:51pm 
does this work with custom dice? I need d3, d5, d7 ect added to some thing like this.
pigneedle  [author] 18 Feb, 2020 @ 10:16pm 
Updated with suggested randomization edits.
Fenrys 22 Jan, 2020 @ 8:02am 
@pigneedle yeah not what I was looking to do but I got it worked out thanks.
pigneedle  [author] 20 Jan, 2020 @ 8:35pm 
@Fenrys That's what the modifier column is for.
Fenrys 19 Jan, 2020 @ 10:41am 
anyway to edit the created buttons with have to input them all over again? I use this for my D&D attack & damage rolls so each time those stats change on my character I'm have to wipe out and reenter the custom buttons. Thanks
Jamster 10 Dec, 2019 @ 11:38pm 
Thank you Pavilchenko!
pigneedle  [author] 2 Dec, 2019 @ 6:10am 
Yep.
TikiTyler 1 Dec, 2019 @ 1:24pm 
If you want it even more random you could
on load math.randomseed(os.time())
on roll math.randomseed(math.random(1,9999999999))
That way you get new seeds each time that are not based on the time.
TikiTyler 1 Dec, 2019 @ 9:05am 
Hey so the original has the seed generation wrong. Its based on time. Make a button with just a d20 and press it once every second or so and you will see its not random at all but time based.
Its because of where the seed generation happens on roll.

You need to take math.randomseed(os.time()) out of the roll function

Current location

--Roll function. Displays roller, then does the random rolls
function roll(o,c)
printThis("((Roll by " .. Player[c].steam_name.."))", c)
math.randomseed(os.time())
local modTotal = 0


Better Location
(Very Top)
function onload(saved_data)
math.randomseed(os.time())
if saved_data ~= nil and saved_data ~= "" then
memory = JSON.decode(saved_data)


I love this thing but the non random nature was pissing me off.
pigneedle  [author] 26 Oct, 2017 @ 7:35am 
@H3xx Same.
H3xx 26 Oct, 2017 @ 7:33am 
This looks badass. I'm an almost religious user of MrStump's original, but my table usually has 4 or 5 per seat because of the shortage of memory slots.