Advertisement
Guest User

Doll

a guest
May 26th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. doll = "Koalla"
  2.  
  3. god = "Bunnywooou"
  4.  
  5. -- Binding the keyboard for god(you)
  6. -- 73 is I, the key for Up.
  7. -- 75 is K, the key for Down
  8. -- 74 is J, the key for Left.
  9. -- 76 is L, the key for Right.
  10.  
  11. for name in pairs(tfm.get.room.playerList) do
  12. -- Instead of binding each key seperately, we put them all in a group.
  13. for keys, k in pairs({73, 74, 75, 76}) do
  14. --And now the keys are binded!
  15. tfm.exec.bindKeyboard(god, k, true, true)
  16. end
  17. end
  18.  
  19.  
  20. function eventKeyboard(god, key, down, x, y)
  21. if key == 73 then
  22. --Moves the player Up by 50 pixels
  23. tfm.exec.movePlayer(doll, 0, 0, true, 0, -50, false)
  24. elseif key == 75 then
  25. -- Moves the player Down by 40 pixels
  26. tfm.exec.movePlayer(doll, 0, 0, true, 0, 40, false)
  27. elseif key == 74 then
  28. -- Moves the player Left by 40 pixels
  29. tfm.exec.movePlayer(doll, 0, 0, true, -40, 0, false)
  30. elseif key == 76 then
  31. -- Moves the player Right by 40 pixels
  32. tfm.exec.movePlayer(doll, 0, 0, true, 40, 0, false)
  33. end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement