Advertisement
Guest User

Boosting your own cannon

a guest
Jan 3rd, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. --code of campal minigame (TFM) made by Dewlp
  2. tbl={};
  3.  
  4. function eventNewPlayer(player)
  5.    tbl[player]=os.time();
  6.    for str,int in pairs({40,83}) do
  7.       tfm.exec.bindKeyboard(player,int,true,true)
  8.    end
  9. end
  10.  
  11. for players in pairs(tfm.get.room.playerList) do
  12. eventNewPlayer(players)
  13. end
  14.  
  15. function eventKeyboard(player,key,press,x,y)
  16.   if (key==40 or key==83) and tbl[player] < os.time()-1225 and not tfm.get.room.playerList[player].isDead then
  17.   if tfm.get.room.playerList[player].isFacingRight then
  18.      tfm.exec.addShamanObject(17, x, y-50 , 120, 10)
  19.      tbl[player]=os.time();
  20.   else
  21.      tfm.exec.addShamanObject(17, x, y-50, 240, 10)
  22.      tbl[player]=os.time();
  23.   end
  24.   end
  25. end
  26.  
  27. function eventLoop()
  28.    for str,int in pairs(tfm.get.room.playerList) do
  29.      if tfm.get.room.playerList[str].isDead and not tfm.get.room.playerList[str].isShaman and tbl[str] <= os.time()-5000 then
  30.         tfm.exec.respawnPlayer(str)
  31.         tbl[str]=os.time();
  32.      end
  33.    end
  34. end
  35.  
  36. print('<n>available keys: <r>40 <n>- <r>down <n>/ <r>83 <n>- <r>S')
  37. tfm.exec.disableAutoNewGame(true)
  38. tfm.exec.disableAutoShaman(true)
  39. tfm.exec.newGame('<C><P L="1600" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" H="10" X="400" Y="135" T="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" H="10" X="801" Y="260" T="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" H="10" X="1200" Y="385" T="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" H="10" X="0" Y="385" T="12" /><S H="65" P="0,0,0,0.2,45,0,0,0" L="65" X="-100" Y="386" T="1" /><S P="0,0,0,0.2,45,0,0,0" L="65" H="65" X="905" Y="260" T="1" /></S><D /><O /></Z></C>')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement