Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------- Halloween 2010 TFM parody -----------------
- ------------------- by Aviener --------------------------
- started = false
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.newGame(6705833)
- for name,player in pairs(tfm.get.room.playerList) do
- system.bindKeyboard(name, 32, true, true)
- end
- function eventKeyboard(name, key, down, x, y)
- if key == 32 then
- tfm.exec.movePlayer(name,0,0,true,0,-50,false)
- end
- end
- function addCheese(x, y)
- ui.addTextArea(0, "<p align='center'><J>Сыр</p>", nil, x, y, 48, 22)
- end
- function pythag(x1,y1,x2,y2)
- return math.sqrt((y2-y1)^2+(x2-x1)^2)
- end
- function eventNewGame()
- tfm.exec.setGameTime(0)
- end
- function eventPlayerWon(n)
- tfm.exec.respawnPlayer(n)
- end
- function eventPlayerDied(n)
- tfm.exec.respawnPlayer(n)
- end
- seconds = 2
- function eventLoop(time, rem)
- if time >= 5000 then
- started = true
- end
- seconds = seconds - 0.5
- if seconds == 0 then
- x = math.random(100, 650)
- y = math.random(50, 350)
- seconds = 2
- addCheese(x, y)
- return x,y
- end
- for name,player in pairs(tfm.get.room.playerList) do
- px = tfm.get.room.playerList[name].x
- py = tfm.get.room.playerList[name].y
- if started == true then
- if pythag(x+20,y+5,px,py) <= 20 and not player.hasCheese then
- tfm.exec.giveCheese(name)
- ui.removeTextArea(0)
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment