Let's say I have rolls made by the API and sometimes when the roll is failed, it has a button to do a reroll. I want this reroll to be made only by the original user, other's wouldn't be able to start the script. Is there a way to check this?
Scott C. said:
Alternatively, if you need everyone to see the roll, simply pass the playerid of the original player as part of the created roll buttons command, then compare that to the playerid of the player clicking the button in your script.
You could also store the id of the original player along with a random number/hash in the script in a map, then pass that hash to the command. That would allow you to let the original person do the reroll, have a public button, and not have someone change the id maliciously. You could also hang other details in that map (like the original status of the roll, what the actual action is, etc) further preventing shenanigans. I use this technique in MutantYearZero, if you wanna look at an example. =DScott C. said:
Alternatively, if you need everyone to see the roll, simply pass the playerid of the original player as part of the created roll buttons command, then compare that to the playerid of the player clicking the button in your script.