bapereira

Meep falsificado

Oct 15th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. --[[
  2. Project's author: Nettoork#0000
  3. ]]--
  4.  
  5. dataPlayer={}
  6.  
  7. function eventNewPlayer(name)
  8. tfm.exec.bindKeyboard(name,32,true,true)
  9. dataPlayer[name]={
  10. time=os.time(),
  11. }
  12. end
  13.  
  14. function eventKeyboard(name,key,down,x,y)
  15. if key == 32 then
  16. if dataPlayer[name].time < os.time()-1000 then
  17. tfm.exec.displayParticle(20,x,y)
  18. local p1X = x
  19. local p1Y = y
  20. for jogador,player in pairs(tfm.get.room.playerList) do
  21. local p2X = tfm.get.room.playerList[jogador].x
  22. local p2Y = tfm.get.room.playerList[jogador].y
  23. local distanceX=(p1X-p2X)-50
  24. if distanceX <= 0 then
  25. distanceX=-distanceX
  26. end
  27. local distanceY=(p1Y-p2Y)-50
  28. if distanceY <= 0 then
  29. distanceY=-distanceY
  30. end
  31. if p2X < p1X and p2X > p1X-100 and jogador ~= name then
  32. tfm.exec.movePlayer(jogador, 0, 0, false, -distanceX, 0, true)
  33. end
  34. if p2X > p1X and p2X < p1X+100 and jogador ~= name then
  35. tfm.exec.movePlayer(jogador, 0, 0, false, distanceX, 0, true)
  36. end
  37. if p2Y <= p1Y and p2Y >= p1Y-100 and jogador ~= name and p2X > p1X-100 and p2X < p1X+100 then
  38. tfm.exec.movePlayer(jogador, 0, 0, false, 0, -distanceY, true)
  39. end
  40. if p2Y > p1Y and p2Y <= p1Y+100 and jogador ~= name and p2X > p1X-100 and p2X < p1X+100 then
  41. tfm.exec.movePlayer(jogador, 0, 0, false, 0, distanceY, true)
  42. end
  43. end
  44. dataPlayer[name].time = os.time()
  45. end
  46. end
  47. end
  48.  
  49. table.foreach(tfm.get.room.playerList, eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment