Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- thick = 0.1
- size = 1
- function onLoad(save_state)
- local button = {
- click_function = "dud",
- function_owner = self,
- label = 0,
- position = {0,thick,0},
- scale = {size, 1, size},
- width = 0,
- height = 0,
- font_size = 800,
- color = {0,0,0,0},
- font_color = {1,1,1,100}
- }
- if save_state ~= "" then button.label = save_state end
- self.createButton(button)
- button.click_function = "add"
- button.label = "+"
- button.position = {1,thick,0}
- button.width = 500
- button.height = 1000
- self.createButton(button)
- button.click_function = "sub"
- button.label = "-"
- button.position = {-1,thick,0}
- self.createButton(button)
- end
- function dud() end
- function add() addsub(1) end
- function sub() addsub(-1) end
- function addsub(x)
- local buttons = self.getButtons()
- buttons[1].label = tonumber(buttons[1].label) + x
- if buttons[1].label < 0 then buttons[1].label = 0 end
- self.editButton(buttons[1])
- self.script_state = buttons[1].label
- end
- function getCount()
- local buttons = self.getButtons()
- return buttons[1].label
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement