Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Crido por Bloonshack
- -- Vamp inverno
- -- 25/08/17
- -- Mapas e inicio
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- players={}
- toDespawn={}
- maps={[[0]],[[1]],[[2]],[[3]],[[4]],[[5]],[[6]],[[7]],[[8]],[[9]],[[10]],[[11]],[[12]],[[13]],[[14]],[[15]],[[16]],[[17]],[[18]],[[19]],[[20]],[[21]],[[22]],[[23]],[[24]],[[25]],[[26]],[[27]],[[28]],[[29]],[[30]],[[31]],[[32]],[[33]],[[34]],[[35]],[[36]],[[37]],[[38]],[[39]],[[40]],[[41]],[[42]],[[43]],[[44]],[[45]],[[46]],[[47]],[[48]],[[49]],[[50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60]],[[61]],[[62]],[[63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[79]],[[80]],[[81]],[[82]],[[83]],[[84]],[[85]],[[86]],[[87]],[[88]],[[89]],[[90]],[[91]],[[92]],[[93]],[[94]],[[95]],[[96]],[[97]],[[98]],[[99]],[[100]],[[101]],[[102]],[[103]],[[104]],[[105]],[[106]],[[107]],[[115]],[[116]],[[117]],[[118]],[[119]],[[120]],[[121]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]]}
- function eventNewPlayer(name)
- for i,key in ipairs({32,40,83}) do
- tfm.exec.bindKeyboard(name,key,true,true)
- end
- players[name]={
- timestamp=os.time(),
- offsets={x=2, y=10}
- }
- end
- conjurar={[[1]],[[2]],[[10]],[[17]],[[23]],[[24]],[[28]],[[33]],[[34]],[[35]],[[39]],[[40]],[[54]],[[57]],[[59]],[[65]],[[68]],[[70]],[[85]],[[89]],[[90]],[[95]],[[96]],[[97]],[[2814]]}
- function eventKeyboard(name,key,down,x,y)
- if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
- if players[name].timestamp < os.time()-600 then
- local id
- if tfm.get.room.playerList[name].isFacingRight then
- id=tfm.exec.addShamanObject(conjurar[math.random(#conjurar)],x+players[name].offsets.x,y+players[name].offsets.y,0,20,0)
- else
- id=tfm.exec.addShamanObject(conjurar[math.random(#conjurar)],x+players[name].offsets.x,y+players[name].offsets.y,0,-20,0)
- end
- players[name].timestamp=os.time()
- table.insert(toDespawn,{os.time(),id})
- end
- end
- end
- function eventChatCommand(name,command)
- local arg={}
- for argument in command:gmatch("[^%s]+") do
- table.insert(arg,argument)
- end
- if arg[1]=="off" then
- if tonumber(arg[2]) and tonumber(arg[3]) then
- players[name].offsets.x=tonumber(arg[2])
- players[name].offsets.y=tonumber(arg[3])
- else
- players[name].offsets.x=2
- players[name].offsets.y=10
- end
- tfm.exec.chatMessage("Offsets changed to X:"..players[name].offsets.x.." Y:"..players[name].offsets.y,name)
- end
- end
- function eventNewGame()
- started=false
- end
- function eventLoop(time,remaining)
- if time >= 3000 and not started then
- started=true
- end
- if remaining<=0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- for i,cannon in ipairs(toDespawn) do
- if cannon[1] <= os.time()-3000 then
- tfm.exec.removeObject(conjurar[2])
- table.remove(toDespawn,i)
- end
- end
- end
- function eventPlayerDied(name)
- local i=0
- local n
- for pname,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i=i+1
- n=pname
- end
- end
- if i==0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- elseif i==1 then
- tfm.exec.giveCheese(n)
- tfm.exec.playerVictory(n)
- tfm.exec.setGameTime(0)
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- tfm.exec.newGame(maps[math.random(#maps)])
- -- Transformar player em vampiro
- players = {}
- for name,player in pairs(tfm.get.room.playerList) do
- table.insert(players,name)
- end
- tfm.exec.setVampirePlayer(players[math.random(#players)])
- -- Nevar
- tfm.exec.snow()
- local loopCount = 0
- function eventLoop()
- if loopCount == 0 then
- tfm.exec.snow()
- tfm.exec.snow()
- end
- loopCount = (loopCount + 1) % 100
- end
- -- Nomes coloridos
- for i, v in pairs(tfm.get.room.playerList) do
- tfm.exec.setNameColor(v.playerName, math.random(0,0xffffff))
- end
Add Comment
Please, Sign In to add comment