Advertisement
Guest User

Haduken

a guest
Dec 28th, 2017
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. data = {}
  2. ktimer = 0
  3.  
  4. function eventNewPlayer(name)
  5. for name,player in pairs(tfm.get.room.playerList) do
  6. data[name] = {
  7. ["c"]=0,
  8. tempo=os.time(),
  9. }
  10. end
  11. tfm.exec.bindKeyboard(name,40,true,true)
  12. tfm.exec.bindKeyboard(name,39,true,true)
  13. tfm.exec.bindKeyboard(name,37,true,true)
  14. end
  15.  
  16. for name,player in pairs(tfm.get.room.playerList) do
  17. eventNewPlayer(name)
  18. tfm.exec.setPlayerScore(name,0,false)
  19. end
  20.  
  21. function eventKeyboard(name,key,down,x,y)
  22. if key == 40 and data[name].tempo < os.time()-10000 then
  23. data[name].c=1
  24. data[name].tempo = os.time();
  25. end
  26. if data[name].c == 1 and key == 39 or data[name].c == 1 and key == 37 then
  27. tfm.exec.setPlayerScore(name,1,false)
  28. data[name].c=0
  29. if os.time() > ktimer then
  30. local right = tfm.get.room.playerList[name].isFacingRight
  31. for i = 1,100 do
  32. tfm.exec.displayParticle(9,(x + (right and 5 or -5)) + (right and math.sqrt(i*2)*4 or -math.sqrt(i*2)*4),y-2,(right and 5 or -5))
  33. tfm.exec.displayParticle(9,(x + (right and 5 or -5)) + (right and math.sqrt(i*2)*4 or -math.sqrt(i*2)*4),y-1,(right and 5 or -5))
  34. tfm.exec.displayParticle(9,(x + (right and 5 or -5)) + (right and math.sqrt(i*2)*4 or -math.sqrt(i*2)*4),y-0,(right and 5 or -5))
  35. tfm.exec.displayParticle(9,(x + (right and 5 or -5)) + (right and math.sqrt(i*2)*4 or -math.sqrt(i*2)*4),y+1,(right and 5 or -5))
  36. end
  37. ktimer = os.time() + 500
  38. end
  39. end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement