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

Checking is a player has died in a certain area

watkins577

As3, lua, xml scripter
Joined
Sep 20, 2008
Messages
130
Reaction score
0
Ok, I have made a quest which must be done solo (and this is done by using stones to block it) but if the player dies during the quest, nobody else can do it unless a GM unblocks it, so what I'm asking is if someone can make a script to check if a player has died between 176, 128, 8, and 185, 128, 8.
 
Lua:
local fromPos = {}
local toPos = {}

function onDeath(cid)
    if(isInArea(getCreaturePosition(cid), fromPos, toPos) == TRUE) then
        -- do whatever
    end

    return TRUE
end

ok?
 
All credits goes to Alidane :p
Lua:
local config = {
    fromPos = {x = 100, y = 100, z = 7},
    toPos = {x = 200, y = 200, z = 7}
}

function onDeath(cid)
    if(isInArea(getCreaturePosition(cid), config.fromPos, config.toPos) == TRUE) then
        -- Reset the quest here
    end

    return TRUE
end
 
Thanks guys, Im gonna put this in my ot now, and stop using the events I did have (they were really buggy lol)

Edit: I got it working, but I cant work out how to remove the 10 demons that spawn using this.

Edit2: I have found a way to remove creatures, however I get...

[21/05/2009 21:19:17] Lua Script Error: [CreatureScript Interface]
[21/05/2009 21:19:17] data/creaturescripts/scripts/playerdeath.lua:eek:nDeath

[21/05/2009 21:19:17] luaGetCreatureName(). Creature not found

sometimes... Is there any way to fix it (BTW I use isMonster(Mon) == TRUE)
 
Last edited:
Back
Top