لعبة pew pew

Turkitutuu

Active Mouse
السكربت
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoTimeLeft(true)
players={}
toDespawn={}
maps={"@11054","@3885","@8330","@12630","@11055","@15852","@7929","@17080","@12908","@9158","@12296","@9721","@8501","@8048","@30","@8757","@15890","@12219","@8032","@12396","@12905","@8509","@8276","@2152","@2189","@8031","@1915","@11168","@2959","@7962","@7508","@2256","@2231","@16342","@12851","@8447","@9347","@10248","@7961","@7951","@1638","@2053","@7601","@2233","@15970","@8385","@11083","@15756","@11133","@15201"};
items={1,2,3,4,6,7,10,101,102,103,104,105,106,107,201,202,203,204,205,206,207,208,209,210,301,302,303,304,305,306,307,401,402,403,404,405,406,407,408,409,60,45,601,602,603,23,24,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,701,39,35,34,28,96,90,62,59,1002,1003,1004,1005,54}
ui.addPopup(1,0,"<font size='14'>Welcome to MiniGame: </font><font size='18'><b><font color='#2F7FCC'>Pewpew </font><br></b></font><br><font color='#2F7FCC'><font size='14'>Goal: </font></font>Stay Alive During the Battle of Objects! </br> <BR></BR><BR><font size='14'><font color='#2F7FCC'>How To play :</font></font> <N>Press the Space key or the down arrow to shoot an object.</br> <BR></BR><BR><b><font color='#2F7FCC'> Questions, Complaints or Suggestions: Contact Thausael#4543.</b></br> </font>",playerName,230,140,340)

function eventNewPlayer(name)
for i,key in ipairs({32,40,83}) do
system.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
if tfm.get.room.playerList[name].isFacingRight then
id=tfm.exec.addShamanObject(items[math.random(#items)], 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 1 or 1, 35)
else
id=tfm.exec.addShamanObject(items[math.random(#items)], x+(tfm.get.room.playerList[name].isFacingLeft and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, tfm.get.room.playerList[name].isFacingLeft and 1 or 1, -35)
end
table.insert(toDespawn,{os.time(),id})
players[name].timestamp=os.time()
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()
ui.setMapName("<VP>#Pewpew")
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)])
 
Last edited by a moderator:

Rosaly

Cheesus
أحسنت عملا !
 

Erin1

Cheesus
حلوو
 
Top
"Dev-TR" theme by Soulzone