function yenimap()
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoScore(true)
guc=35
maps={7816994,
7816995,
7816998,
7817002,
7817003,
7817005,
7817006,
7817007,
7817009}
tfm.exec.newGame(maps[math.random(#maps)])
tfm.exec.snow(300,guc)
end
yenimap()
zaman=0
guczaman=0
guc=35
function eventLoop()
guczaman=guczaman+0.5
if guczaman==5 then
guc=guc+5
tfm.exec.snow(300,guc)
guczaman=0
end
for name,player in pairs(tfm.get.room.playerList) do
if kartopu[name].top>0 then
kartopu[name].top=kartopu[name].top-1
end
end
if zaman>0 then
zaman=zaman-1
end
if zaman==1 then
yenimap()
end
end
tfm.exec.chatMessage("Kartopu Savaşına hoş geldiniz. Hayatta kalan kazanır, bol şans!")
kartopu={}
function eventNewPlayer(name)
kartopu[name]={top=0}
tfm.exec.bindKeyboard(name, 69, true, true)
tfm.exec.bindKeyboard(name, 83, true, true)
tfm.exec.bindKeyboard(name, 40, true, true)
end
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
function eventKeyboard(n, key, down, x, y)
if key==69 or 83 or 40 then
if kartopu[n].top==0 then
kartopu[n].top=3
if tfm.get.room.playerList[n].isFacingRight then
tfm.exec.addShamanObject(34,x+7,y,0,20)
else
tfm.exec.addShamanObject(34,x-7,y,180,-20)
end
end
end
end
function eventPlayerDied(n)
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==1 then
if not n.isShaman then
tfm.exec.chatMessage(""..n.." hayatta kaldı ve kazandı, tebrikler!")
tfm.exec.giveCheese(n)
tfm.exec.playerVictory(n)
tfm.exec.setPlayerScore(n,1)
zaman=10
end
end
end