Advertisement
Hachem16

Small Particle show

Dec 8th, 2013
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. Particle = {3, 30}
  2.  
  3.  
  4. numbers=10
  5. emote={}
  6.  
  7. function eventNewPlayer(name)
  8.     tfm.exec.bindKeyboard(name,32,true,true)
  9. end
  10.  
  11. for name,player in pairs(tfm.get.room.playerList) do
  12.     eventNewPlayer(name)
  13. end
  14.  
  15. function eventKeyboard(playerName,key,down,x,y)
  16.         if key==32 then
  17.                 if tfm.get.room.playerList[playerName].isFacingRight then
  18.                         for i=1,4 do
  19.                             if emote[playerName] then
  20.                                 tfm.exec.displayParticle(emote[playerName], x, y+(i*10), 5, 0.05, 0.05, 0, nil)
  21.                             else
  22.                                 tfm.exec.displayParticle(5, x, y+(i*10), 5, 0.05, 0.05, 0, nil)
  23.                             end
  24.  
  25.                         end
  26.                 else
  27.                         for i=1,4 do
  28.                                 if emote[playerName] then
  29.                                     tfm.exec.displayParticle(emote[playerName], x, y+(i*10), -5, 0.05, -0.05, 0, nil)
  30.                                 else
  31.                                      tfm.exec.displayParticle(5, x, y+(i*10), -5, 0.05, -0.05, 0, nil)
  32.                                 end
  33.  
  34.                         end
  35.         end
  36. end
  37. end
  38.  
  39. function eventChatCommand(playerName, cmd)
  40.                 if cmd:sub(0,4) == "part" then
  41.                       emote[playerName]=cmd:sub(6)
  42.         end
  43. end
  44.  
  45. function eventLoop()
  46. for i=1,numbers do
  47.                 tfm.exec.displayParticle(math.random(3, 4), math.random(50,100), math.random(20, 250), 1, 0, 0, 0, nil)
  48. end
  49. end
  50.  
  51. system.disableChatCommandDisplay("part", true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement