Advertisement
Itchyboy

Title Powers

Dec 23rd, 2014
1,992
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.66 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. ninja=false
  3. worsh2={0,10,20,30,40}
  4. m={0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210}
  5. dead=0
  6. wj=false
  7. bodyDef={
  8. type=4,
  9. width=10,
  10. height=60,
  11. foreground=false,
  12. friction=20,
  13. restitution=0,
  14. angle=0,
  15. miceCollision=true,
  16. groundCollision=false,
  17. dynamic=false,
  18. }
  19. powers={sexy={},wj={},speed={fast={},agile={},pirate={},ninja={}},over={},sham={},cheese={},hawk={},snow={},vamp={},myst={},cheese2={}}
  20. players=0
  21. function eventNewPlayer(name)
  22. players=players+1
  23. if tfm.get.room.playerList[name].title==9 then table.insert(powers.speed.fast,name) powers.speed.fast[name]=true
  24. elseif tfm.get.room.playerList[name].title==81 then table.insert(powers.over,name) powers.over[name]=true
  25. elseif tfm.get.room.playerList[name].title==70 then tfm.exec.bindKeyboard(name,32,true,true) table.insert(powers.wj,name) powers.wj[name]={gtype,bool=false,bool2=true,num=0}  powers.wj[name].gtype=players wj=true
  26. elseif tfm.get.room.playerList[name].title==3 then table.insert(powers.sham,name) powers.sham[name]=true
  27. elseif tfm.get.room.playerList[name].title==8 then table.insert(powers.cheese,name) powers.cheese[name]=true tfm.exec.bindKeyboard(name,67,true,true)
  28. elseif tfm.get.room.playerList[name].title==10 then table.insert(powers.speed.agile,name) powers.speed.agile[name]=true
  29. elseif tfm.get.room.playerList[name].title==11 then table.insert(powers.speed.pirate,name) powers.speed.pirate[name]=true
  30. elseif tfm.get.room.playerList[name].title==12 then table.insert(powers.speed.ninja,name) powers.speed.ninja[name]={jump=0,bool=true} ninja=true
  31. elseif tfm.get.room.playerList[name].title==125 then table.insert(powers.sexy,name) powers.sexy[name]=true
  32. elseif tfm.get.room.playerList[name].title==56 then tfm.exec.bindKeyboard(name,75,true,true)
  33. elseif tfm.get.room.playerList[name].title==47 then tfm.exec.bindKeyboard(name,32,true,true) table.insert(powers.hawk,name) powers.hawk[name]=true
  34. elseif tfm.get.room.playerList[name].title==245 then table.insert(powers.snow,name) powers.snow[name]=true
  35. elseif tfm.get.room.playerList[name].title==287 then table.insert(powers.vamp,name) powers.vamp[name]=true
  36. elseif tfm.get.room.playerList[name].title==329 then table.insert(powers.myst,name) powers.myst[name]=true
  37. elseif tfm.get.room.playerList[name].title==294 then table.insert(powers.cheese2,name) powers.cheese2[name]=true
  38. end
  39. end
  40. for i,v in pairs(tfm.get.room.playerList) do eventNewPlayer(i) end
  41. function eventNewGame()
  42. for i,v in pairs(tfm.get.room.playerList) do
  43. if powers.sham[i] then tfm.exec.setShaman(i)
  44. elseif powers.vamp[i] then tfm.exec.setVampirePlayer(i)
  45. end
  46. end
  47. dead=0
  48. end
  49. function eventPlayerWon(name)
  50. dead=dead+1
  51. if dead==players then tfm.exec.setGameTime(5) end
  52. end
  53. function eventPlayerDied(name)
  54. dead=dead+1
  55. if dead==players then tfm.exec.setGameTime(5) end
  56. end
  57. function eventPlayerLeft(name)
  58. dead=dead+1 players=players-1
  59. if dead==players then tfm.exec.setGameTime(5) end
  60. end
  61. function eventKeyboard(name,key,down,x,y)
  62. for i,v in pairs(tfm.get.room.playerList) do
  63. if key==32 then if powers.wj[name].bool2 then if powers.wj[name].num==0 then powers.wj[name].bool=true powers.wj[name].num=1 elseif powers.wj[name]==true then powers.wj[name].bool=false tfm.exec.removePhysicObject(powers.wj[name].gtype) powers.wj[name].num=0 elseif powers.hawk[name] then tfm.exec.movePlayer(name,0,0,true,0,-50) end end
  64. elseif key==67 and powers.cheese[name] and v.score>=40 then tfm.exec.setPlayerScore(name,-40,true) tfm.exec.giveCheese(name)
  65. elseif key==75 then tfm.exec.giveCheese(i) tfm.exec.setPlayerScore(i,-(100/players),true) tfm.exec.explosion(v.x,v.y,10,100) tfm.exec.killPlayer(name)
  66. end
  67. end
  68. end
  69. function eventLoop(t,tr)
  70. for i,v in pairs(tfm.get.room.playerList) do
  71. if powers.speed.fast[i] then if v.movingRight then tfm.exec.movePlayer(i,0,0,true,100) elseif v.movingLeft then tfm.exec.movePlayer(i,0,0,true,-100) end
  72. elseif powers.speed.agile[i] then if v.movingRight then tfm.exec.movePlayer(i,0,0,true,150) elseif v.movingLeft then tfm.exec.movePlayer(i,0,0,true,-150) end
  73. elseif powers.speed.pirate[i] then if v.movingRight then tfm.exec.movePlayer(i,0,0,true,200) elseif v.movingLeft then tfm.exec.movePlayer(i,0,0,true,-200) end
  74. elseif ninja then if powers.speed.ninja[i].bool then if powers.speed.ninja[i].jump<3 then powers.speed.ninja[i].jump=powers.speed.ninja[i].jump+1 end if v.isJumping and powers.speed.ninja[i].jump==3 then powers.speed.ninja[i].jump=0 tfm.exec.movePlayer(i,0,0,true,0,-75) end if v.movingRight then tfm.exec.movePlayer(i,0,0,true,250) elseif v.movingLeft then tfm.exec.movePlayer(i,0,0,true,-250) end end
  75. elseif wj then if powers.wj[i].bool then if v.isFacingRight then tfm.exec.addPhysicObject(powers.wj[i].gtype,v.x+20,v.y-10,bodyDef) else tfm.exec.addPhysicObject(powers.wj[i].gtype,v.x-20,v.y-10,bodyDef) end end
  76. elseif powers.over[i] then tfm.exec.setPlayerScore(i,9001)
  77. elseif powers.sexy[i] then tfm.exec.displayParticle(2,v.x+worsh2[math.random(#worsh2)],v.y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(2,v.x-worsh2[math.random(#worsh2)],v.y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(0,v.x+worsh2[math.random(#worsh2)],v.y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(0,v.x-worsh2[math.random(#worsh2)],v.y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(1,v.x+worsh2[math.random(#worsh2)],v.y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(1,v.x-worsh2[math.random(#worsh2)],v.y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(11,v.x+worsh2[math.random(#worsh2)],v.y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(11,v.x-worsh2[math.random(#worsh2)],v.y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(13,v.x+worsh2[math.random(#worsh2)],v.y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(13,v.x-worsh2[math.random(#worsh2)],v.y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(4,v.x+worsh2[math.random(#worsh2)],v.y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(4,v.x-worsh2[math.random(#worsh2)],v.y-worsh2[math.random(#worsh2)],0,0,0,0)
  78. end
  79. if love then tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,v.x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[lover].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[lover].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y-worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x+worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y+worsh2[math.random(#worsh2)],0,0,0,0) tfm.exec.displayParticle(6,tfm.get.room.playerList[loved].x-worsh2[math.random(#worsh2)],tfm.get.room.playerList[loved].y-worsh2[math.random(#worsh2)],0,0,0,0) end
  80. end
  81. if tr<=0 then tfm.exec.newGame(m[math.random(#m)])
  82. end
  83. end
  84. function eventChatCommand(name,cmd)
  85. local args={}
  86. for i in cmd:gmatch('%S+') do table.insert(args,i) end
  87. if cmd=='snow' and powers.snow[name] then tfm.exec.snow()
  88. elseif cmd=='mystery' and powers.myst[name] then local x={tfm.exec.setVampirePlayer(name),tfm.exec.setShaman(name),tfm.exec.explosion(tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y,100,200),tfm.exec.giveCheese(name),tfm.exec.playerVictory(name),tfm.exec.setNameColor(name,math.random(0x000000,0xFFFFFF)),tfm.exec.snow()} math.random(#x)
  89. elseif args[1]=='cheese' and powers.cheese2[name] and args[2] then lover=name loved=args[2] love=true
  90. end
  91. end
  92. system.disableChatCommandDisplay('snow',true)
  93. system.disableChatCommandDisplay('mystery',true)
  94. system.disableChatCommandDisplay('cheese',true)
  95. tfm.exec.newGame(m[math.random(#m)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement