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.newGame("@6385854")
- 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
- if message=="clear" then
- for id, object in pairs(tfm.get.room.objectList) 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)
- 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)
- local tx=tfm.get.room.playerList[player].x
- local ty=tfm.get.room.playerList[player].y
- local tangle=(180/math.pi)*math.atan2((y-ty),(x-tx))
- local rx=x-tx
- local ry=y-ty
- print(tangle)
- if x>tx then
- tfm.exec.addShamanObject(35, tx+20, ty, tangle, 30, ry/rx*30, false)
- elseif x<tx then
- tfm.exec.addShamanObject(35, tx-20, ty, tangle, -30, ry/rx*(-30), false)
- elseif x==tx and y>ty then
- tfm.exec.addShamanObject(35, tx, ty+15, tangle, 0, 30, false)
- elseif x==tx and y<ty then
- tfm.exec.addShamanObject(35, tx, ty-15, tangle, 0, -30, false)
- end
- end
- for name in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
Advertisement
Add Comment
Please, Sign In to add comment