• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

explosion

Nerevr back

Member
Joined
Nov 7, 2014
Messages
269
Reaction score
7
i want script when use lever make explosion in x=x y=x z=z and remove the wall to open way
Im use Tfs 0.4 8.60
 
2cpyukz.jpg

will be somthing like this
 
Code:
local positions = {
     {x = 93, y = 125, z = 7},
     {x = 93, y = 126, z = 7},
     {x = 93, y = 127, z = 7}
}
local wallid = 387

local function doCreateWalls()
     for x = 1, #positions do
         doCreateItem(wallid, 1, positions[x])
     end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
     for x = 1, #positions do
         local wall = getTileItemById(positions[x], wallid).uid
         if wall > 0 then
             doRemoveItem(wall, 1)
             doSendMagicEffect(positions[x], CONST_ME_FIREAREA)
             doSendDistanceShoot(toPosition, positions[x], CONST_ANI_FIRE)
         else
             doPlayerSendCancel(cid, "Wait a moment.")
             doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
             return true
         end
     end
     addEvent(doCreateWalls, 20 * 1000)
     return true
end
 
Code:
local positions = {
     {x = 93, y = 129, z=7},
     {x = 94, y = 129, z=7},
     {x = 95, y = 129, z=7}
}
local wallid = 387

local function doCreateWalls()
     for x = 1, #positions do
         doCreateItem(wallid, 1, positions[x])
     end
end

local function doRemoveWalls(toPosition)
     for x = 1, #positions do
         local wall = getTileItemById(positions[x], wallid).uid
         if wall > 0 then
             doRemoveItem(wall, 1)
             doSendMagicEffect(positions[x], CONST_ME_FIREAREA)
             doSendDistanceShoot(toPosition, positions[x], CONST_ANI_FIRE)
         end
     end
     addEvent(doCreateWalls, 20 * 1000)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
     if exhaustion.check(cid, 39445) then
         return doPlayerSendCancel(cid, "The cannon is loading.")
     end
     for x = 0, 19 do
         addEvent(doSendAnimatedText, x * 1000, toPosition, 20 - x, COLOR_RED)
     end
     addEvent(doRemoveWalls, 20 * 1000, toPosition)
     exhaustion.set(cid, 39445, 40)
     return true
end
Don't test with a god character.
 
Back
Top