Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onLoad(save_state)
- self.createButton({
- click_function = "click",
- function_owner = self,
- label = "Click ME",
- position = {0,1,0}
- })
- end
- function click()
- local firstClick = Timer.destroy("firstClick")
- local secondClick = Timer.destroy("secondClick")
- if firstClick == false then
- Timer.create({
- identifier = "firstClick",
- function_name = "oneClick",
- function_owner = self,
- delay = 1
- })
- else
- Timer.create({
- identifier = "firstClick",
- function_name = "dud",
- function_owner = self,
- delay = 2
- })
- if secondClick == false then
- Timer.create({
- identifier = "secondClick",
- function_name = "doubleClick",
- function_owner = self,
- delay = 1
- })
- else
- print("3+")
- end
- end
- end
- function oneClick()
- print("oneClick")
- end
- function doubleClick()
- print("doubleClick")
- end
- function dud() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement