Script de Guerra de Objetos :)

Ir em baixo

Script de Guerra de Objetos :)

Mensagem por Admin em Sab Ago 19, 2017 12:10 pm

local pool = {}
local obj = -1

function eventChatCommand(name, cmd)
if cmd == 'a' then
obj = tfm.enum.shamanObject.balloonFish
elseif cmd == 'b' then
obj = tfm.enum.shamanObject.cupidonArrow
elseif cmd == 'c' then
obj = tfm.enum.shamanObject.chicken
elseif cmd == 'd' then
obj = tfm.enum.shamanObject.littleBox
elseif cmd == 'e' then
obj = tfm.enum.shamanObject.box
elseif cmd == 'f' then
obj = tfm.enum.shamanObject.littleBoard
elseif cmd == 'g' then
obj = tfm.enum.shamanObject.board
elseif cmd == 'h' then
obj = tfm.enum.shamanObject.ball
elseif cmd == 'i' then
obj = tfm.enum.shamanObject.trampoline
elseif cmd == 'j' then
obj = tfm.enum.shamanObject.anvil
elseif cmd == 'k' then
obj = tfm.enum.shamanObject.cannon
elseif cmd == 'l' then
obj = tfm.enum.shamanObject.bomb
elseif cmd == 'm' then
obj = tfm.enum.shamanObject.orangePortal
elseif cmd == 'n' then
obj = tfm.enum.shamanObject.blueBalloon
elseif cmd == 'o' then
obj = tfm.enum.shamanObject.redBalloon
elseif cmd == 'p' then
obj = tfm.enum.shamanObject.greenBalloon
elseif cmd == 'q' then
obj = tfm.enum.shamanObject.yellowBalloon
elseif cmd == 'r' then
obj = tfm.enum.shamanObject.rune
elseif cmd == 's' then
obj = tfm.enum.shamanObject.snowBall
elseif cmd == 't' then
obj = tfm.enum.shamanObject.apple
elseif cmd == 'u' then
obj = tfm.enum.shamanObject.sheep
elseif cmd == 'v' then
obj = tfm.enum.shamanObject.littleBoardIce
elseif cmd == 'x' then
obj = tfm.enum.shamanObject.littleBoardChocolate
elseif cmd == 'w' then
obj = tfm.enum.shamanObject.iceCube
elseif cmd == 'y' then
obj = tfm.enum.shamanObject.cloud
elseif cmd == 'z' then
obj = tfm.enum.shamanObject.bubble
elseif cmd == 'aa' then
obj = tfm.enum.shamanObject.tinyBoard
elseif cmd == 'bb' then
obj = tfm.enum.shamanObject.companionCube
elseif cmd == 'cc' then
obj = tfm.enum.shamanObject.stableRune
elseif cmd == 'dd' then
obj = tfm.enum.shamanObject.longBoard
elseif cmd == 'ee' then
obj = tfm.enum.shamanObject.triangle
elseif cmd == 'ff' then
obj = tfm.enum.shamanObject.sBoard
elseif cmd == 'gg' then
obj = tfm.enum.shamanObject.paperPlane
elseif cmd == 'hh' then
obj = tfm.enum.shamanObject.rock
elseif cmd == 'ii' then
obj = tfm.enum.shamanObject.pumpkinBall
elseif cmd == 'jj' then
obj = tfm.enum.shamanObject.tombstone
elseif cmd == 'll' then
obj = tfm.enum.shamanObject.paperBall
elseif cmd == 'mm' then
obj = tfm.enum.shamanObject.arrow

end
end

function eventKeyboard(name, key, down, x, y)
if key == 69 and obj ~= -1 then
local facingRight = tfm.get.room.playerList[name].isFacingRight
table.insert(pool, {tfm.exec.addShamanObject(obj, facingRight and x + 8 or x - 8, y - 7, 0, facingRight and 20 or -20), os.time()})
end
end

function eventLoop(el, rm)
for i,v in ipairs(pool) do
if v[2] < os.time() - 3000 then
tfm.exec.removeObject(v[1])
table.remove(pool, i)
end
end
end

function eventNewPlayer(name)
system.bindKeyboard(name, 69, false)
end

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



Admin
Admin

Mensagens : 14
Data de inscrição : 10/07/2017

Ver perfil do usuário http://tfmbry.directorioforuns.com

Voltar ao Topo Ir em baixo

Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum