Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(disable)
- tfm.exec.newGame("@6385854")
- tx=0
- ty=0
- tangle=0
- rx=0
- ry=0
- function eventChatCommand(name,message)
- if message=="skip" then
- tfm.exec.setGameTime (0 , true )
- end
- if message=="respawn" then
- tfm.exec.respawnPlayer(name)
- end
- if message=="long" then
- tfm.exec.setGameTime(9999, true)
- end
- local IDList = {}
- if message=="clear" then
- for id, object in pairs(tfm.get.room.objectList) do
- table.insert(IDList, id)
- end
- for i, id in pairs(IDList) do
- tfm.exec.removeObject(id)
- end
- end
- end
- function eventNewPlayer(name)
- for _, k in pairs({40, 83, 32}) do
- tfm.exec.bindKeyboard(name, k, true, true)
- end
- system.bindMouse(name,true)
- tfm.exec.setPlayerScore(name, 100, false)
- end
- function eventKeyboard(player, key, down, x, y)
- if key==40 or key==83 then
- if tfm.get.room.playerList[player].isFacingRight==true then
- tfm.exec.addShamanObject(35, x+15, y, 0, 30, 0, false)
- elseif tfm.get.room.playerList[player].isFacingRight==false then
- tfm.exec.addShamanObject(35, x-15, y, 180, -30, 0, false)
- end
- end
- if key==32 then
- tfm.exec.movePlayer(player,0,0,true,0,-50,false)
- end
- end
- function eventMouse(player,x,y)
- tx=tfm.get.room.playerList[player].x
- ty=tfm.get.room.playerList[player].y
- tangle=(180/math.pi)*math.atan2((y-ty),(x-tx))
- rx=x-tx
- ry=y-ty
- if math.abs(ry)>=math.abs(rx) then
- if ry<0 then
- rx=(rx/math.abs(ry))*30
- ry=-30
- elseif ry>0 then
- rx=(rx/math.abs(ry))*30
- ry=30
- end
- elseif math.abs(rx)>math.abs(ry) then
- if rx<0 then
- ry=(ry/math.abs(rx))*30
- rx=-30
- elseif rx>0 then
- ry=(ry/math.abs(rx))*30
- rx=30
- end
- end
- if x>tx then
- tfm.exec.addShamanObject(35, tx+30, ty, tangle, rx, ry, false)
- elseif x<tx then
- tfm.exec.addShamanObject(35, tx-30, ty, tangle, rx, ry, false)
- elseif x==tx and y>ty then
- tfm.exec.addShamanObject(35, tx, ty+30, tangle, 0, 30, false)
- elseif x==tx and y<ty then
- tfm.exec.addShamanObject(35, tx, ty-30, tangle, 0, -30, false)
- end
- end
- function eventPlayerDied(name)
- tfm.exec.setPlayerScore(name, -1, true)
- tfm.exec.respawnPlayer(name)
- end
- for name in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement