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

Solved When Monster Dies, it will remove items???

Samaster

Raptorserver.ddns.net
Joined
Jun 9, 2013
Messages
291
Reaction score
23
Location
UK
I made this script for the last part of my quest where when the monster dies, it will remove the items blocking the teleports to the reward room. However, i get an error on loadup and i dont know why?

Script:
Code:
function onKill(cid, target, damage, flags)
if(isPlayer(target)) then
  return true
end
if(getCreatureName(target):lower() == "Protector") then
    doRemoveItem(1484), {x = 920,y = 1153,z = 9}
    doRemoveItem(1484), {x = 921,y = 1153,z = 9}
    doRemoveItem(1484), {x = 922,y = 1153,z = 9}
    doRemoveItem(1484), {x = 928,y = 1153,z = 9}
    doRemoveItem(1484), {x = 929,y = 1153,z = 9}
    doRemoveItem(1484), {x = 930,y = 1153,z = 9}
    end
    return true
    end

And my error:
Code:
[30/12/2013 09:39:01] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/soft boots quest 2.lua:6: unexpected symbol near ','
[30/12/2013 09:39:01] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/soft boots quest 2.lua)
[30/12/2013 09:39:01] data/creaturescripts/scripts/soft boots quest 2.lua:6: unexpected symbol near ','

Can someone with experience help me please? :)
 
Code:
    doRemoveItem(getTileItemById({x = 920,y = 1153,z = 9}, 1484).uid)
    doRemoveItem(getTileItemById({x = 921,y = 1153,z = 9}, 1484).uid)
    doRemoveItem(getTileItemById({x = 922,y = 1153,z = 9}, 1484).uid)
    doRemoveItem(getTileItemById({x = 928,y = 1153,z = 9}, 1484).uid)
    doRemoveItem(getTileItemById({x = 929,y = 1153,z = 9}, 1484).uid)
    doRemoveItem(getTileItemById({x = 930,y = 1153,z = 9}, 1484).uid)
 
You also have to write the name of the monster without capitals
if(getCreatureName(target):lower() == "protector") then

You can also remove the items like this.
Code:
local pos = {
   {x = 920, y = 1153, z = 9},
   {x = 921, y = 1153, z = 9},
   {x = 922, y = 1153, z = 9},
   {x = 928, y = 1153, z = 9},
   {x = 929, y = 1153, z = 9},
   {x = 930, y = 1153, z = 9}
}

for i = 1, #pos do
   if(getTileItemById(pos[i], 1484).uid > 0) then
     doRemoveItem(getTileItemById(pos[i], 1484).uid)
   end
end
 

Similar threads

Back
Top