Advertisement
Itchyboy

The Haunted Doll Improved

Oct 14th, 2014
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. doll={}
  2.  
  3. -- Insert YOUR name here without removing the quotation marks.
  4. god = "Tig"
  5. -- That's it! Done! You can now run the script and troll people!
  6.  
  7. ------------------------------------------------------------------------------------------------------
  8. ------------------------------------------------------------------------------------------------------
  9. ------------------------------------------------------------------------------------------------------
  10. -----Do NOT edit the following code unless you're a developer, otherwise it probably won't work.------
  11. ------------------------------------------------------------------------------------------------------
  12. ------------------------------------------------------------------------------------------------------
  13. ------------------------------------------------------------------------------------------------------
  14.  
  15. -- Binding the keyboard for god(you)
  16. -- 73 is I, the key for Up.
  17. -- 75 is K, the key for Down
  18. -- 74 is J, the key for Left.
  19. -- 76 is L, the key for Right.
  20.  
  21. for name in pairs(tfm.get.room.playerList) do
  22. -- Instead of binding each key seperately, we put them all in a group.
  23.     for keys, k in pairs({73, 74, 75, 76}) do
  24. --And now the keys are binded!
  25.         tfm.exec.bindKeyboard(god, k, true, true)
  26.     end
  27. end
  28.  
  29. -- Listening for keyboard events.
  30. -- You'll notice that move values are different because it makes the doll easier to control.
  31.  
  32. function eventKeyboard(god, key, down, x, y)
  33.     if key == 73 then
  34. --Moves the player Up by 50 pixels
  35.         tfm.exec.movePlayer(doll[1], 0, 0, true, 0, -50, false)
  36.     elseif key == 75 then
  37. -- Moves the player Down by 40pixels
  38.         tfm.exec.movePlayer(doll[1], 0, 0, true, 0, 40, false)
  39.     elseif key == 74 then
  40. -- Moves the player Left by 40 pixels
  41.         tfm.exec.movePlayer(doll[1], 0, 0, true, -40, 0, false)                
  42.     elseif key == 76 then
  43. -- Moves the player Right by 40 pixels
  44.         tfm.exec.movePlayer(doll[1], 0, 0, true, 40, 0, false)                      
  45.     end
  46. end
  47.  
  48. function eventChatCommand(name,cmd)
  49. local args = {}
  50.         for i in string.gmatch(cmd, "%S+") do table.insert(args, i) end
  51.         if (table.getn(args) > 1) then
  52. if args[1]=='doll' then table.insert(doll,1,args[2])
  53. -- Prints out you your doll only to you.
  54.  
  55. print("<font color='#FFFF00'>"..doll[1].."<font color='#FFFF00'> is now your doll!")
  56. end
  57. end
  58. end
  59. system.disableChatCommandDisplay('doll')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement