Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.snow()
- local isInRaceMode = 1
- local TimeTicks = 10
- banned = {}
- toDespawn={}
- function eventKeyboard(name,key,down,x,y)
- if tfm.get.room.playerList[name].isFacingRight then
- id=tfm.exec.addShamanObject(1,x+40,y,0, 100, 0)
- else
- id=tfm.exec.addShamanObject(1,x-40,y,0, -100, 0)
- end
- table.insert(toDespawn,{os.time(),id})
- end
- if key==32 then
- tfm.exec.movePlayer(name,0,0,true,0,-50,false)
- end
- local loopCount = 0
- function eventLoop(curtime,rcurtime)
- for i,cannon in ipairs(toDespawn) do
- if cannon[1] <= os.time()-3000 then
- tfm.exec.removeObject(cannon[2])
- table.remove(toDespawn,i)
- end
- end
- math.randomseed( os.time() )
- rndX=math.random(800)
- rndP=math.random(20)
- rndY=math.random(400)
- tfm.exec.displayParticle(rndP, rndX, rndY, 0, 0, 0, 0, nil)
- math.randomseed( os.time() )
- rndX=math.random(800)
- rndP=math.random(20)
- rndY=math.random(400)
- tfm.exec.displayParticle(rndP, rndX, rndY, 0, 0, 0, 0, nil)
- math.randomseed( os.time() )
- rndX=math.random(800)
- rndP=math.random(20)
- rndY=math.random(400)
- tfm.exec.displayParticle(rndP, rndX, rndY, 0, 0, 0, 0, nil)
- --if loopCount == 0 then
- --tfm.exec.snow()
- --tfm.exec.snow()
- --end
- --loopCount = (loopCount + 1) % 100
- if isInRaceMode == 1 then
- TimeTicks=TimeTicks-1
- if TimeTicks == 1 then
- raceClearWalls()
- isInRaceMode=2
- end
- end
- if isInRaceMode == 0 then
- tfm.exec.explosion(1, 1, 999e999, 9999, true)
- end
- end
- function eventChatCommand(name, cmd)
- local cmd_args = {}
- for arg in cmd:gmatch("[^%s]+") do -- splits the command by spaces.
- table.insert(cmd_args, arg) -- inserts them into the table
- end
- if cmd_args[2] ~= nil then
- if cmd_args[1] == "msg" then
- ui.addPopup(1,0, name.."вывел на экран сообщение"..cmd_args[2], nil, 0, 20, 800, false)
- end
- if cmd_args[1] == "map" then
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.newGame(cmd_args[2])
- tfm.exec.setUIMapName("Nobody must know")
- tfm.exec.setShaman(name)
- end
- if cmd_args[1] == "test" then
- print("Tested succesfully")
- end
- if cmd_args[1] == "free-build" then
- tfm.exec.newGame("<C><P H='800' L='3200' /><Z><S><S L='3000' H='10' X='1600' Y='790' T='1' P='0,0,1,0.2,0,0,0,0' /></S><D /><O /></Z></C>")
- for name2, player in pairs(tfm.get.room.playerList) do
- tfm.exec.setShaman(name2)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoShaman(true)
- end
- end
- if cmd_args[1] == "ban" then
- if name == "Pontvanilla" or name == "Romanaveer" then
- table.insert(banned, cmd_args[2])
- tfm.exec.killPlayer(cmd_args[2])
- end
- end
- end
- if cmd_args[1] == "race" then
- tfm.exec.disableAutoShaman(true)
- tfm.exec.newGame("<C><P L='3000' H='1600' /><Z><S><S L='3000' H='20' X='1490' Y='800' T='6' P='0,0,0.3,0.2,0,0,0,0' /><S L='10' X='1599' H='800' Y='391' T='1' P='0,0,0,0.2,0,0,0,0' /><S L='10' H='1600' X='-5' Y='776' T='1' P='0,0,0,0.2,0,0,0,0' /><S L='1600' o='324650' H='10' X='800' Y='0' T='12' P='0,0,0.3,0.2,0,0,0,0' /><S L='10' H='785' X='1596' Y='398' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='10' H='792' X='-1' Y='395' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' H='10' X='800' Y='80' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' X='800' H='10' Y='180' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' X='800' H='10' Y='280' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' H='10' X='800' Y='380' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' X='800' H='10' Y='480' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' H='10' X='800' Y='580' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' X='800' H='10' Y='680' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='10' H='800' X='760' Y='400' T='4' lua='2' P='0,0,20,0.2,0,0,0,0' /><S L='10' X='800' H='800' Y='400' T='4' lua='1' P='0,0,20,0.2,0,0,0,0' /></S><D><T Y='789' X='20' /><T Y='790' X='1580' /><F Y='569' X='779' /><F Y='669' X='781' /><F Y='787' X='780' /><F Y='470' X='783' /><F Y='370' X='781' /><F Y='269' X='778' /><F Y='170' X='781' /><F Y='71' X='781' /></D><O /></Z></C>")
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.setUIMapName("Race")
- isInRaceMode = 1
- for name, player in pairs(tfm.get.room.playerList) do
- tfm.exec.movePlayer(name, 790, 100, false, 0, 1, false)
- end
- end
- if cmd_args[1] == "break" then
- if name == "Pontvanlla" then
- system.exit()
- end
- end
- if cmd_args[1] == "s" then
- tfm.exec.setShaman(name)
- end
- end
- function eventPlayerDied(plr)
- tfm.exec.respawnPlayer(plr)
- if plr == "Joneanony" then
- tfm.exec.killPlayer("Jneanonym")
- end
- end
- function eventNewPlayer(playerName)
- for i,key in ipairs({32,40,83}) do
- tfm.exec.bindKeyboard(name,key,true,true)
- end
- --tfm.exec.bindKeyboard(name,32,true,true)
- if playerName == "Joneanonym" then
- tfm.exec.killPlayer("Joneanonym")
- end
- ui.addPopup(1,0, "игрок"..playerName, nil, 0, 20, 800, false)
- end
- function eventPlayerWon(plr, el,elresp)
- tfm.exec.respawnPlayer(plr)
- if isInRaceMode==3 then
- ui.addPopup(1,0, "Лолка "..plr.."!!!", nil, 0, 20, 800, false)
- isInRaceMode=0
- tfm.exec.setTimeLeft(20)
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.disableAutoScore(false)
- tfm.exec.disableAutoShaman(false)
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- system.bindMouse(name, true)
- tfm.exec.bindKeyboard(name, 39, true, true)
- tfm.exec.bindKeyboard(name,32,true,true)
- end
- function eventMouse(name, x, y)
- rndP=math.random(20)
- tfm.exec.displayParticle(rndP, x, y, 0, 0, 1, 0, nil)
- rndP=math.random(20)
- tfm.exec.displayParticle(rndP, x, y, 0, 0, 0, 1, nil)
- rndP=math.random(20)
- tfm.exec.displayParticle(rndP, x, y, 0, 0, 1, 0, nil)
- rndP=math.random(20)
- tfm.exec.displayParticle(rndP, x, y, 0, 0, 0, 1, nil)
- rndP=math.random(20)
- tfm.exec.displayParticle(rndP, x, y, 0, 0, 1, 0, nil)
- --tfm.exec.movePlayer(name, x, y, false, 0, 0, true)
- tfm.exec.explosion(x, y, 999999, 50, false)
- tfm.exec.displayParticle(5, x, y, 9999, 1, 0, 0, nil)
- end
- function raceClearWalls()
- tfm.exec.removePhysicObject(1)
- tfm.exec.removePhysicObject(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement