Script de Gelados
Página 1 de 1
Script de Gelados
print("<N>Olá! <font color='#000000'>#Gelados<N> é um minigame muito gelado tente não ficar gripado se não você pode morrer com muito frio!!!<font color='#000000'>#Gelados!")
maps={4446416,4414828,4431469,4433446,4413886}
players={}
function returnMouseCount()
count=0
for player in pairs(tfm.get.room.playerList) do
if(tfm.get.room.playerList[player].isDead==false) then
count=count+1
elseif(players[player].id) then
count=count+1
end
end
return count
end
function eventLoop(time,remaining)
returnMouseCount()
if(remaining<=0 or count==0) then
newRound()
end
playerList=tfm.get.room.playerList
end
function newRound()
tfm.exec.newGame(maps[math.random(#maps)])
end
function eventNewGame()
tfm.exec.snow()
tfm.exec.setUIMapName("<N> Bem-vindo ao <font color= '#000000'>#Gelados! <N>Pressione <font color='#000000'>W<N> para se transformar em um cubo de gelo!<N>Pressione <font color='#000000'>X<N> para se transformar em uma prancha de gelo! Diverta-se!\n")
end
function eventNewPlayer(name)
ui.addTextArea(1,"<p align='center'><b><N>Olá! <font color='# 000000'>#Gelados!<N> é um minigame muito gelado tente não ficar gripado se não você pode morrer com muito frio!!! <font color='# 000000'>#Gelados!</b></p>", name, 5,25, 790, 25, 0x000000, 0x000000, 0)
tfm.exec.bindKeyboard(name,87,true,true)
tfm.exec.bindKeyboard(name,88,true,true)
players[name]={timestamp=os.time()}
end
function eventKeyboard(name,key,down,x,y)
if players[name].timestamp < os.time()-800 then
if(key==87 and playerList[name].isDead==false) then
tfm.exec.killPlayer(name)
local id=tfm.exec.addShamanObject(54,x,y)
players[name]={id=id,x=x,y=y}
elseif(key==88 and playerList[name].isDead==false) then
tfm.exec.killPlayer(name)
local id=tfm.exec.addShamanObject(45,x,y)
players[name]={id=id,x=x,y=y}
else
if(players[name].x and players[name].y and players[name].id) then
local id=players[name].id
tfm.exec.respawnPlayer(name)
players[name].x=tfm.get.room.objectList[id].x
players[name].y=tfm.get.room.objectList[id].y
if(players[name].x==0) then tfm.exec.killPlayer(name)
else
tfm.exec.movePlayer(name,players[name].x,players[name].y)
end
tfm.exec.removeObject(id)
players[name].id=nil
end
end
players[name].timestamp=os.time()
end
end
function main()
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.newGame(maps[math.random(#maps)])
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end
main()
function eventPlayerWon(name)
players[name].x=nil
players[name].y=nil
players[name].id=nil
end
function eventPlayerGetCheese(name)
tfm.exec.playerVictory(name)
end
maps={4446416,4414828,4431469,4433446,4413886}
players={}
function returnMouseCount()
count=0
for player in pairs(tfm.get.room.playerList) do
if(tfm.get.room.playerList[player].isDead==false) then
count=count+1
elseif(players[player].id) then
count=count+1
end
end
return count
end
function eventLoop(time,remaining)
returnMouseCount()
if(remaining<=0 or count==0) then
newRound()
end
playerList=tfm.get.room.playerList
end
function newRound()
tfm.exec.newGame(maps[math.random(#maps)])
end
function eventNewGame()
tfm.exec.snow()
tfm.exec.setUIMapName("<N> Bem-vindo ao <font color= '#000000'>#Gelados! <N>Pressione <font color='#000000'>W<N> para se transformar em um cubo de gelo!<N>Pressione <font color='#000000'>X<N> para se transformar em uma prancha de gelo! Diverta-se!\n")
end
function eventNewPlayer(name)
ui.addTextArea(1,"<p align='center'><b><N>Olá! <font color='# 000000'>#Gelados!<N> é um minigame muito gelado tente não ficar gripado se não você pode morrer com muito frio!!! <font color='# 000000'>#Gelados!</b></p>", name, 5,25, 790, 25, 0x000000, 0x000000, 0)
tfm.exec.bindKeyboard(name,87,true,true)
tfm.exec.bindKeyboard(name,88,true,true)
players[name]={timestamp=os.time()}
end
function eventKeyboard(name,key,down,x,y)
if players[name].timestamp < os.time()-800 then
if(key==87 and playerList[name].isDead==false) then
tfm.exec.killPlayer(name)
local id=tfm.exec.addShamanObject(54,x,y)
players[name]={id=id,x=x,y=y}
elseif(key==88 and playerList[name].isDead==false) then
tfm.exec.killPlayer(name)
local id=tfm.exec.addShamanObject(45,x,y)
players[name]={id=id,x=x,y=y}
else
if(players[name].x and players[name].y and players[name].id) then
local id=players[name].id
tfm.exec.respawnPlayer(name)
players[name].x=tfm.get.room.objectList[id].x
players[name].y=tfm.get.room.objectList[id].y
if(players[name].x==0) then tfm.exec.killPlayer(name)
else
tfm.exec.movePlayer(name,players[name].x,players[name].y)
end
tfm.exec.removeObject(id)
players[name].id=nil
end
end
players[name].timestamp=os.time()
end
end
function main()
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.newGame(maps[math.random(#maps)])
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end
main()
function eventPlayerWon(name)
players[name].x=nil
players[name].y=nil
players[name].id=nil
end
function eventPlayerGetCheese(name)
tfm.exec.playerVictory(name)
end
Tópicos semelhantes
» Script The Moviments
» Script dos Movimentos
» Script de Casamento S2
» Script de Desfile
» Script da Forca
» Script dos Movimentos
» Script de Casamento S2
» Script de Desfile
» Script da Forca
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|