My first release
5 players stands on their spots, pulls the switch, the bomb will get activated, 5 minutes later, the bomb will explode and kill everyone in the room.
The mission is to destroy the wall before the time is out!
Here's screenshots:
Here's the script:
data/actions/scripts/bomb.lua
data/actions/actions.xml (Change XXXX to the Unique ID of the switch)
Hope you like it, if you do, Rep++?
5 players stands on their spots, pulls the switch, the bomb will get activated, 5 minutes later, the bomb will explode and kill everyone in the room.
The mission is to destroy the wall before the time is out!
Here's screenshots:
Here's the script:
data/actions/scripts/bomb.lua
PHP:
function count4()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
doSendAnimatedText(bombPos, "4 minutes", TEXTCOLOR_YELLOW)
addEvent(count3, 60*1000)
end
function count3()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
doSendAnimatedText(bombPos, "3 minutes", TEXTCOLOR_YELLOW)
addEvent(count2, 60*1000)
end
function count2()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
doSendAnimatedText(bombPos, "2 minutes", TEXTCOLOR_YELLOW)
addEvent(count1, 60*1000)
end
function count1()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
doSendAnimatedText(bombPos, "1 minute", TEXTCOLOR_YELLOW)
addEvent(sec5, 30*1000)
end
function sec5()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
doSendAnimatedText(bombPos, "30 seconds", TEXTCOLOR_YELLOW)
addEvent(sec4, 20*1000)
end
function sec4()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
doSendAnimatedText(bombPos, "10 seconds", TEXTCOLOR_YELLOW)
addEvent(sec3, 5*1000)
end
function sec3()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
doSendAnimatedText(bombPos, "5 seconds", TEXTCOLOR_YELLOW)
addEvent(sec2, 3*1000)
end
function sec2()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
doSendAnimatedText(bombPos, "BEEP", TEXTCOLOR_YELLOW)
addEvent(explode, 2*1000)
end
function explode()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
local bombRemove = getThingFromPos(bombPos)
doTransformItem(bombRemove.uid, 9889, 1)
for x = 92, 98 do -- X Position of the explosion area
for y = 142, 148 do -- Y Position of explosion area
local areaPos = {x=x, y=y, z=7, stackpos=253}
local die = getThingFromPos(areaPos)
doSendMagicEffect(areaPos, CONST_ME_FIREATTACK)
if isPlayer(die.uid) == TRUE then
doCreatureAddHealth(die.uid, -getCreatureMaxHealth(die.uid))
end
end
end
end
function bomb()
local bombPos = {x=95, y=144, z=7, stackpos=2} -- Position of the bomb
local bomb = getThingFromPos(bombPos)
doTransformItem(bomb.uid, 9890, 1)
addEvent(count4, 2*1000)
end
local playerPos = {
{x=94,y=128,z=7}, -- Position of player 1
{x=96,y=128,z=7}, -- Position of player 2
{x=94,y=130,z=7}, -- Position of player 3
{x=96,y=130,z=7}, -- Position of player 4
{x=95,y=129,z=7} -- Position of player 5
}
local newPlayerPos = {x=106,y=129,z=7} -- Positon where the players should get teleported when using the switch
function onUse(cid, item, frompos, item2, topos)
local playersTeleport = {}
for i, v in ipairs(playerPos) do
local players = getTopCreature(v).uid or getTopCreature(v)
if isPlayer(players) ~= TRUE then
return FALSE
else
table.insert(playersTeleport, players)
end
end
for i, v in ipairs(playersTeleport) do
doTeleportThing(v, newPlayerPos)
doPlayerSendTextMessage(cid, 19, "!!! Bomb has been activated , you have 5 minutes to get out !!!")
addEvent(bomb, 1000)
end
end
data/actions/actions.xml (Change XXXX to the Unique ID of the switch)
<action uniqueid="XXXX" event="script" value="bomb.lua"/>
Hope you like it, if you do, Rep++?
Last edited: