Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Project's author: Nettoork#0000
- ]]--
- function eventNewPlayer(name)
- tfm.exec.bindKeyboard(name,32,true,true)
- end
- function eventKeyboard(name,key,down,x,y)
- if key == 32 then
- local p1X = tfm.get.room.playerList[name].x
- local p1Y = tfm.get.room.playerList[name].y
- for jogador,player in pairs(tfm.get.room.playerList) do
- local p2X = tfm.get.room.playerList[jogador].x
- local p2Y = tfm.get.room.playerList[jogador].y
- if p2X < p1X and p2X > p1X-100 and jogador ~= name then
- tfm.exec.movePlayer(jogador, 0, 0, false, -100, 0, true)
- end
- if p2X > p1X and p2X < p1X+100 and jogador ~= name then
- tfm.exec.movePlayer(jogador, 0, 0, false, 100, 0, true)
- end
- if p2Y < p1Y and p2Y > p1Y-100 and jogador ~= name and p2X > p1X-100 and p2X < p1X+100 then
- tfm.exec.movePlayer(jogador, 0, 0, false, 0, -100, true)
- end
- if p2Y > p1Y and p2Y < p1Y+100 and jogador ~= name and p2X > p1X-100 and p2X < p1X+100 then
- tfm.exec.movePlayer(jogador, 0, 0, false, 0, 100, true)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement