Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- TABLAS --
- players={}
- life=3
- -- FUNCIONES --
- function eventNewPlayer(name)
- if not players[name] then
- players[name]={life=3}
- elseif players[name] then
- players[name]={life=3}
- end
- end
- function eventNewGame(name)
- for k,_ in pairs(tfm.get.room.playerList) do
- eventNewPlayer(k)
- end
- end
- function eventPlayerDied(name)
- players[name].life=players[name].life-1
- if players[name].life > 0 then
- tfm.exec.respawnPlayer(name)
- end
- end
- function eventLoop()
- for name,p in pairs(players) do
- for player in pairs(tfm.get.room.playerList) do
- player_x=tfm.get.room.playerList[player].x
- player_y=tfm.get.room.playerList[player].y
- name_x=tfm.get.room.playerList[name].x
- name_y=tfm.get.room.playerList[name].y
- if players[name].life == 3 then
- tfm.exec.displayParticle(5,name_x-50, name_y-50,0,0, 0, 0, name)
- tfm.exec.displayParticle(5,name_x-50, name_y-50,0,0, 0, 0, name)
- tfm.exec.displayParticle(5,name_x-50, name_y-50,0,0, 0, 0, name)
- elseif players[name].life == 2 then
- tfm.exec.displayParticle(5,name_x-50, name_y-50,0,0, 0, 0, name)
- tfm.exec.displayParticle(5,name_x-50, name_y-50,0,0, 0, 0, name)
- elseif players[name].life == 1 then
- tfm.exec.displayParticle(5,name_x-50, name_y-50,0,0, 0, 0, name)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment