Botchy
Mouse
Code:
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
players={}
toDespawn={}
DOWN = 40
DOWN1 = string.byte("S")
maps={"@531471","@531472","@531473","@531474","@531475","@531476","@531477","@531478","@531479","@531480","@531481"}
function eventNewGame()
started=false
tfm.exec.setGameTime (120)
tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
ui.setShamanName ("V1.0.0")
ui.setMapName ("Meep War - By Botchy")
print("مرحباً بكم في سكربت Meep War")
for name,player in pairs(tfm.get.room.playerList) do tfm.exec.giveMeep(name) end
end
function eventNewPlayer(name)
players[name]={
timestamp=os.time(),
offsets={x=2, y=10}
}
tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
ui.setShamanName ("Alpha")
ui.setMapName ("Meep War - By Botchy")
print("مرحباً بكم في سكربت Meep War")
ui.addPopup(1,0,"Meep War - By Botchy",nil,300,200,200,true)
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(cannon[2])
table.remove(toDespawn,i)
end
end
for name, player in pairs(tfm.get.room.playerList) do
system.bindKeyboard(name, DOWN, true)
system.bindKeyboard(name, DOWN1, true)
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
elseif i==1 then
tfm.exec.giveCheese(n)
tfm.exec.playerVictory(n)
tfm.exec.setGameTime(5)
end
end
function eventKeyboard(name, keyCode, down, x, y)
if keyCode == DOWN or keyCode == DOWN1 then
tfm.exec.explosion(x, y + 30, 20, 60, true)
tfm.exec.displayParticle(tfm.enum.particle.spirit, x, y + 30)
end
end
tfm.exec.newGame(maps[math.random(#maps)]);
tfm.exec.setNameColor("Botchy",0xEB1D51)
tfm.exec.setNameColor("name",0x00ff00)
tfm.exec.setNameColor("name",0x00ff00)
tfm.exec.setNameColor("name",0x00ff00)
