Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Add global variable for users color
- pColor = "Orange"
- -- Add a setColorTint to the onload function to automatically color the diceroller for the player
- function onload(saved_data)
- self.setColorTint(pColor)
- end
- -- Add the function for the scripting buttons
- function onScriptingButtonDown(index, playerColor)
- -- Roll dice
- if playerColor == pColor and index == 1 then
- buttonClick_roll(self, playerColor)
- end
- -- Clear dice
- if playerColor == pColor and index == 2 then
- buttonClick_clear(self, playerColor)
- end
- -- Set number of dice to 1 and roll
- if playerColor == pColor and index == 3 then
- howManyDice = 1
- self.editButton({index=0, label=howManyDice})
- buttonClick_roll(self, playerColor)
- end
- -- Set number of dice to 2 and roll
- if playerColor == pColor and index == 4 then
- howManyDice = 2
- self.editButton({index=0, label=howManyDice})
- buttonClick_roll(self, playerColor)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment