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

Lua How to remove/transform Corpose after monster die?

tavax

New Member
Joined
Apr 29, 2009
Messages
17
Reaction score
2
My scripit


Code:
local function removeTeleport(killer, Ppos)
local Ppos2 = {x = 33313, y = 31592, z = 15}
             
    doTeleportThing(killer[1], Ppos)
    doCreateMonster("ChestDH",Ppos2)
    return TRUE
end




function onDeath(cid, corpse, killer)

local playerid = getPlayerGUID(killer[1])
Query = db.getResult("SELECT  `account_id` FROM  `players` WHERE  `players`.`id` = "..playerid..";")
local accid = Query:getDataInt("account_id")

Query2 = db.getResult("SELECT  `dh_q` FROM  `accounts` WHERE  `accounts`.`id` = "..accid..";")
local quest = Query2:getDataInt("dh_q")

local Ppos = {x = 33327, y = 31589, z = 14}
local time_to_pass = 5 -- in seconds
local monstName = "ChestDH"
local pos = getCreaturePosition(cid)




  if quest < 1 then       
    if isMonster(cid) then
        if string.lower(getCreatureName(cid)) == string.lower(monstName) then
          doCreatureSay(cid, "You have 15 seconds to get your loot. "..playerid.." .", TALKTYPE_ORANGE_1)
          db.executeQuery("UPDATE `accounts` SET `dh_q` = 1 WHERE `accounts`.`id` ="..accid..";")
            addEvent(removeTeleport, (1000*time_to_pass), killer, Ppos)
        end
    end
  else
    doRemoveItem(corpse.uid, 1)
    doCreatureSay(cid, "You already have made this quest!!", TALKTYPE_ORANGE_1)
    addEvent(removeTeleport, (1000*time_to_pass), killer, Ppos)
  end
    return TRUE
end


All works expect --> doRemoveItem(corpse.uid, 1) <<---- How can i remove the body or remove the loot ??
 
Last edited:
Back
Top