• 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!

Script For Xml 8.1

kafo

Well-known Member
Joined
Oct 14, 2011
Messages
209
Reaction score
17
Location
Egypt
I want Script When Monester Die The Wall Remove And The Wall Close Automatic After 20 Second Please I neeed Help
 
so u want a script when monster dies the wall gets removed and then it is back after 20 sec?

Code:
local cfg = {
    from_pos = {x = 1707,y = 2305,z = 7}, --  area south-west corner.
    to_pos = {x = 1729,y = 2343,z = 7}, --  area north-east corner.
    mobpos = {x = 1000,y = 2343,z = 7}, --pos where this monster will be summoned
    wallpos = {x = 1010,y= 1212,z=7}, -- pos of the wall
    timetospawn = 20 -- seconds to spawn this creature(s)
    wallid = x -- Change this to the id of the wall
    }
 
local mob = {"Rat", "Caverat"} -- change rat and caverat to a creature names :)
local function k()
doCreateMonster(mob[math.random(#mob)], cfg.mobpos, false, true, true)
doCreateItem(cfg.wallid, 1, cfg.wallpos)
end

function onKill(cid, target, damage, flags)
if isMonster(target) and getCreatureMaster(target) == target and isInRange(getCreaturePosition(target), cfg.from_pos, cfg.to_pos) and isInArray(mob, getCreatureName(target):lower()) then
doRemoveItem(getTileItemById(cfg.wallpos, cfg.wallid).uid)
addEvent(k, cfg.timetospawn*1000)
end
return true
end
register
XML:
 <event type="kill" name="MobKill" event="script" value="mobkill.lua"/>

at login.lua
Code:
registerCreatureEvent(cid, "BossKill")
 
Back
Top