SHARE
TWEET

Stranger Things (apertar espaço)

bapereira Oct 15th, 2019 (edited) 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.     Project's author: Nettoork#0000
  3. ]]--
  4.  
  5. function eventNewPlayer(name)
  6.     tfm.exec.bindKeyboard(name,32,true,true)
  7. end
  8.  
  9. function eventKeyboard(name,key,down,x,y)
  10.     if key == 32 then
  11.             local p1X = tfm.get.room.playerList[name].x
  12.             local p1Y = tfm.get.room.playerList[name].y
  13.         for jogador,player in pairs(tfm.get.room.playerList) do
  14.             local p2X = tfm.get.room.playerList[jogador].x
  15.             local p2Y = tfm.get.room.playerList[jogador].y
  16.             if p2X < p1X and p2X > p1X-100 and jogador ~= name then
  17.                 tfm.exec.movePlayer(jogador, 0, 0, false, -100, 0, true)
  18.             end
  19.             if p2X > p1X and p2X < p1X+100 and jogador ~= name then
  20.                 tfm.exec.movePlayer(jogador, 0, 0, false, 100, 0, true)
  21.             end
  22.             if p2Y < p1Y and p2Y > p1Y-100 and jogador ~= name and p2X > p1X-100 and p2X < p1X+100 then
  23.                 tfm.exec.movePlayer(jogador, 0, 0, false, 0, -100, true)
  24.             end
  25.             if p2Y > p1Y and p2Y < p1Y+100 and jogador ~= name and p2X > p1X-100 and p2X < p1X+100 then
  26.                 tfm.exec.movePlayer(jogador, 0, 0, false, 0, 100, true)
  27.             end
  28.         end
  29.     end
  30. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top