Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoShaman(true)
- players = {}
- function INIT()
- started = false
- tfm.exec.newGame('<C><P /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="198" o="8a1a1a" H="79" X="294" Y="274" T="12" lua="0" /><S P="0,0,0.3,0.2,0,0,0,0" L="198" o="116189" lua="1" X="511" Y="274" T="12" H="79" /><S P="0,0,0,0,0,0,0,0" L="11" o="ffffffff" H="385" Y="214" T="12" X="190" /><S L="11" o="ffffffff" H="385" X="615" Y="214" T="12" P="0,0,0,0,0,0,0,0" /></S><D><DS Y="-9" X="400" /></D><O /></Z></C>')
- for name,player in pairs (tfm.get.room.playerList) do
- players[name] = {x = tfm.get.room.playerList[name].x} -- puts coordinates in table (for each player)
- end
- end
- function getCoords()
- m = 0
- n = 0
- for name,player in pairs(tfm.get.room.playerList) do
- if (players[name].x >= 195 and players[name].x <= 392) then -- checks coordinates and count mice
- m = m + 1
- else
- n = n + 1
- end
- return n, m
- end
- end
- function removePlatform()
- getCoords()
- if m > n then -- compares the number of mice on platforms
- tfm.exec.removePhysicObject(0)
- else
- tfm.exec.removePhysicObject(1)
- end
- end
- sec = 10
- function eventLoop() --timer
- sec = sec - 0.5
- if sec == 0 then
- started = true
- removePlatform()
- end
- end
- INIT ()
Add Comment
Please, Sign In to add comment