AulaMice está voltando aos poucos. Pedimos desculpa pelo transtorno.

Entre para seguir isso  
Seguidores 0
#reactioN

Deatmatch Lua

1 post neste tópico

tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoTimeLeft(true)
players={}
toDespawn={}
maps={"@92648","@640647","@24646","@250645","@280644","@290643","@70639","@80638"}
ui.addPopup(1,0,"<font size='14'>Welcome To: </font><font size='18'><b><font color='#2F7FCC'>Deathmatch </font><br></b></font><br><font color='#2F7FCC'><font size='14'>Objective: </font></font>To remain alive during the Battle of Objects!  </br> <BR></BR><BR><font size='14'><font color='#2F7FCC'>How to Play :</font></font> <N>Space key or the down arrow to shoot an object.</br> <BR></BR><BR><b><font color='#2F7FCC'> Questions, Complaints or Suggestions: Please contact me through the game [#react1oN].</b></br> </font>",playerName,230,140,340)

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

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()-1000 then
	local id=tfm.exec.addShamanObject(math.random(1701,1705), x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, tfm.get.room.playerList[name].isFacingRight and 90 or 270)
	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()-4000 then
	tfm.exec.removeObject(cannon[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(5)
	end
end

for name,player in pairs(tfm.get.room.playerList) do
	eventNewPlayer(name)
end

tfm.exec.newGame(maps[math.random(#maps)])

 

0

Compartilhar este post


Link para o post
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!


Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.


Entrar Agora
Entre para seguir isso  
Seguidores 0