• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Ultimate Bomb Release

Aarthec

w0000t
Joined
Apr 25, 2009
Messages
129
Reaction score
0
Location
Sweden
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
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:
This is my Brick wall monster script. i can't get the script working though. could you explain the X,Y,Z locals a little bit better so i know wich is wich. thank's anyways.

HTML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Brick wall" nameDescription="a Destroyable brick wall" race="blood" experience="100000" speed="0" manacost="0">
  <health now="100000" max="100000"/>
  <look typeex="1026" corpse="4585"/>
  <targetchange interval="5000" chance="8"/>
  <strategy attack="0" defense="100"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="0"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="1"/>
    <flag canpushcreatures="1"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="0"/>
  </flags>
  <attacks>
    <attack name="melee" interval="1000" skill="0" attack="0"/>
  </attacks>
  <defenses armor="55" defense="55">
    <defense name="healing" interval="2000" chance="15" min="5000" max="6000">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
  </defenses>
	<elements>
	</elements>
  <immunities>
    <immunity paralyze="1"/>
    <immunity invisible="1"/>
  </immunities>
  <summons>
  </summons>
  <voices interval="5000" chance="10">
    <voice sentence="Squeak..." yell="1"/>
  </voices>
  <loot>
</loot>
</monster>
 
Omg omg omg omg omg omg omg it is veryyyyyyyyyy nicee!! Good u are my idolll i love u (l)
 
why are u using 10 functions to count 10 seconds or wtf ur doing??

use a variable and put all in one lol
 
Code:
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

Isnt there suppose to be 5 new player pos?
 
FREAKING BROKEN HELP US THIS IS SO KEWL BUT DOESNT WORK COME ON DUDE PUT SOME MAYO ON THE YAYO HEEEYY Oo
 
Stop spamming the whole section Diamond. :huh:
 
Back
Top