Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 06/11/2016
- --Last update: 06/11/2016
- --[[ Notes:
- Does:
- Sistema de checkpoint
- Keys
- Space --> Cria o checkpoint (Revive nas coordenadas dele após a morte)
- Shift --> Deleta o último checkpoint e retorna ao anterior
- ]]--
- mice = {}
- eventNewPlayer = function(n)
- mice[n] = {
- coord = {{0,0}},
- }
- for k,v in next,{32,16} do
- system.bindKeyboard(n,v,true,true)
- end
- end
- table.foreach(tfm.get.room.playerList,eventNewPlayer)
- eventNewGame = function()
- for k,v in next,tfm.get.room.playerList do
- mice[k].coord = {{0,0}}
- end
- end
- eventKeyboard = function(n,k,d,x,y)
- if k == 32 then
- table.insert(mice[n].coord,{x,y})
- end
- if k == 16 then
- local c = mice[n].coord
- if #c > 1 then
- table.remove(c)
- end
- end
- end
- eventLoop = function(time)
- if time > 2999 then
- for k,v in next,tfm.get.room.playerList do
- local c = mice[k].coord
- c = c[#c]
- tfm.exec.displayParticle(11,c[1],c[2],0,0,0,0,k)
- end
- end
- end
- eventPlayerDied = function(n)
- local c = mice[n].coord
- c = c[#c]
- tfm.exec.respawnPlayer(n)
- tfm.exec.movePlayer(n,c[1],c[2])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement