Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 02/12/2015
- --Last update: 21/05/2016
- --[[ Notes:
- tfm.exec.respawnPlayer
- Does:
- Revive um jogador, se houver segundo e terceiro argumentos, ele será teletransportado para estes x,y após reviver.
- Args:
- n --> Jogador
- x --> Posição horizontal para mover.
- y --> Posição vertical para mover.
- tfm.exec.giveCheese
- Does:
- Dá queijo à um jogador, e se win for true, dará toca (vitória)
- Args:
- n --> Jogador
- win --> Boolean para dar toca
- system.bindKeyboard
- Does:
- Habilita alguma tecla para algum jogador.
- Args:
- n --> Jogador
- k --> Tabela de teclas (Exemplo: {0,1,2,3})
- d --> Boolean caso o bind seja down.
- a --> Ativar (true) ou desativar (false)
- tfm.exec.getPosition
- Does:
- Retorna a posição do rato.
- Args:
- n --> Jogador
- tfm.exec.movePhysicObject
- Does:
- Move um piso já existente
- Args:
- id --> Id do piso
- x --> Nova posição horizontal x
- y --> Nova posição vertical y
- tfm.exec.getPhysicObjectProperties
- Does:
- Retorna as propriedades do piso
- Args:
- id --> Id do piso
- ]]--
- do
- local respawnPlayer=tfm.exec.respawnPlayer
- tfm.exec.respawnPlayer=function(n,x,y)
- if tfm.get.room.playerList[n].isDead then
- respawnPlayer(n)
- if x and y then
- tfm.exec.movePlayer(n,x,y,false)
- end
- end
- end
- local giveCheese=tfm.exec.giveCheese
- tfm.exec.giveCheese=function(n,win)
- giveCheese(n)
- if win then tfm.exec.playerVictory(n) end
- end
- local bindKeyboard=system.bindKeyboard
- system.bindKeyboard=function(n,k,d,a)
- if type(k) == "table" then
- for k,v in next,k do
- bindKeyboard(n,v,d,a)
- end
- else
- bKeyboard(n,k,d,a)
- end
- end
- local addPhysicObject = {tfm.exec.addPhysicObject,{}}
- tfm.exec.addPhysicObject = function(id,x,y,properties)
- addPhysicObject[1](id,x,y,properties)
- addPhysicObject[2][id] = assert(properties,"[Physic Object] A physic object must have properties")
- end
- tfm.exec.movePhysicObject = function(id,x,y)
- if addPhysicObject[2][id] then
- tfm.exec.addPhysicObject(id,x,y,addPhysicObject[2][id])
- end
- end
- tfm.exec.getPhysicObjectProperties = function(id)
- if addPhysicObject[2][id] then
- return addPhysicObject[2][id]
- end
- end
- end
- tfm.exec.getPosition=function(n)
- return tfm.get.room.playerList[n].x,tfm.get.room.playerList[n].y,tfm.get.room.playerList[n].isFacingRight
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement