SHOW:
|
|
- or go back to the newest paste.
| 1 | - | maps={3107377,305748,1539148,4543602,390649,495880,1463332,1492805,292678,305753,1545834,3175437,2964900,1812056,852617,799141,1794907,2939549,459284,1519483,1794873,811211,306360,489829,479091,3419948,290546,276534,3220945,1754355,281649,390657,311496,295988,802958,2643833}
|
| 1 | + | |
| 2 | tfm.exec.disableAutoNewGame(true) | |
| 3 | tfm.exec.disableAfkDeath(true) | |
| 4 | tfm.exec.disableAutoShaman(true) | |
| 5 | ||
| 6 | - | tfm.exec.newGame(maps[math.random(#maps)]) |
| 6 | + | tfm.exec.newGame("@6385854")
|
| 7 | ||
| 8 | ||
| 9 | function eventChatCommand(name,message) | |
| 10 | if message=="skip" then | |
| 11 | tfm.exec.setGameTime (0 , true ) | |
| 12 | end | |
| 13 | if message=="respawn" then | |
| 14 | tfm.exec.respawnPlayer(name) | |
| 15 | end | |
| 16 | if message=="long" then | |
| 17 | tfm.exec.setGameTime(9999, true) | |
| 18 | end | |
| 19 | if message=="clear" then | |
| 20 | for id, object in pairs(tfm.get.room.objectList) do | |
| 21 | tfm.exec.removeObject(id) | |
| 22 | end | |
| 23 | end | |
| 24 | end | |
| 25 | ||
| 26 | ||
| 27 | function eventNewPlayer(name) | |
| 28 | for _, k in pairs({40, 83, 32}) do
| |
| 29 | tfm.exec.bindKeyboard(name, k, true, true) | |
| 30 | end | |
| 31 | system.bindMouse(name,true) | |
| 32 | end | |
| 33 | ||
| 34 | function eventKeyboard(player, key, down, x, y) | |
| 35 | if key==40 or key==83 then | |
| 36 | if tfm.get.room.playerList[player].isFacingRight==true then | |
| 37 | tfm.exec.addShamanObject(35, x+15, y, 0, 30, 0, false) | |
| 38 | elseif tfm.get.room.playerList[player].isFacingRight==false then | |
| 39 | - | tfm.exec.snow() |
| 39 | + | |
| 40 | end | |
| 41 | - | local loopCount = 0 |
| 41 | + | |
| 42 | - | function eventLoop(time,remaining) |
| 42 | + | |
| 43 | - | if loopCount == 0 then |
| 43 | + | |
| 44 | - | tfm.exec.snow() |
| 44 | + | |
| 45 | - | tfm.exec.snow() |
| 45 | + | |
| 46 | ||
| 47 | - | loopCount = (loopCount + 1) % 100 |
| 47 | + | function eventMouse(player,x,y) |
| 48 | - | if remaining<=0 or time<=0 then |
| 48 | + | local tx=tfm.get.room.playerList[player].x |
| 49 | - | tfm.exec.newGame(maps[math.random(#maps)]) |
| 49 | + | local ty=tfm.get.room.playerList[player].y |
| 50 | local tangle=(180/math.pi)*math.atan2((y-ty),(x-tx)) | |
| 51 | local rx=x-tx | |
| 52 | local ry=y-ty | |
| 53 | ||
| 54 | ||
| 55 | print(tangle) | |
| 56 | if x>tx then | |
| 57 | tfm.exec.addShamanObject(35, tx+20, ty, tangle, 30, ry/rx*30, false) | |
| 58 | elseif x<tx then | |
| 59 | tfm.exec.addShamanObject(35, tx-20, ty, tangle, -30, ry/rx*(-30), false) | |
| 60 | elseif x==tx and y>ty then | |
| 61 | tfm.exec.addShamanObject(35, tx, ty+15, tangle, 0, 30, false) | |
| 62 | elseif x==tx and y<ty then | |
| 63 | tfm.exec.addShamanObject(35, tx, ty-15, tangle, 0, -30, false) | |
| 64 | end | |
| 65 | end | |
| 66 | ||
| 67 | for name in pairs(tfm.get.room.playerList) do | |
| 68 | eventNewPlayer(name) | |
| 69 | end |