Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. --[[ Lua code. See documentation: https://api.tabletopsimulator.com/ --]]
  2. button_parameters = {}
  3. button_parameters.click_function = 'buttonClicked'
  4. button_parameters.function_owner = nil
  5. button_parameters.label = "Deal"
  6. button_parameters.position = {0, 2.3, 0}
  7. button_parameters.rotation = {0, 90, 0}
  8. button_parameters.width = 1000
  9. button_parameters.height = 500
  10. button_parameters.font_size = 500
  11.  
  12. --[[ The onLoad event is called after the game save finishes loading. --]]
  13. function onLoad()
  14. --[[ print('onLoad!') --]]
  15. deckParams = {
  16. type = "Deck",
  17. rotation = {x=0, y=0, z =180}
  18. }
  19.  
  20. botParams = {
  21. type = "Figurine_Card_Bot",
  22. position = {x=5, y=0, z=0}
  23. }
  24.  
  25. timerParams = {
  26. delay = 5,
  27. repetitions = 1,
  28. }
  29.  
  30. mydeck = spawnObject(deckParams)
  31. mybot = spawnObject(botParams)
  32. mybot.createButton(button_parameters)
  33. Timer.create(timerParams)
  34.  
  35.  
  36. end
  37.  
  38. function buttonClicked()
  39. print("Dealing!")
  40. mydeck.dealToAll(13)
  41. end
  42.  
  43. --[[ The onUpdate event is called once per frame. --]]
  44. function onUpdate()
  45. --[[ print('onUpdate loop!') --]]
  46.  
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement