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

Problem with doRemoveItem

Dankoo

Active Member
Joined
Sep 4, 2010
Messages
1,007
Reaction score
27
Can't remove an item with doRemoveItem function :s

some parts of the script

creaturescripts - a monster is summoned and a statue was supposed to be gone, but I receive a message in console saying "<luaDoRemoveItem> item not found>" the creature is summoned, but the statue stills there
LUA:
local statue_iten_pos = {x=32478,y=31758,z=10, stackpos=1}
doRemoveItem(statue_iten_pos.uid)

another creaturescript, when you kill the boss that was summoned in above script

LUA:
local config = {
teleportId = 1387,
statueId = 8835,
bosse = "Black Knight"
}
local portal_in_pos = {x = 32477, y = 31758, z = 10}
local statue_in_pos = {x = 32476, y = 31758, z = 10}
local position = portal_in_pos	
teleport = doCreateItem(config.teleportId,255,position)
statue = doCreateItem(config.statueId,255,statue_in_pos)
doSetItemActionId(teleport, 9023)

and movements, when the player enter the portal and statue and the portal itself was supposed to disappear, but no, the GROUND disappear and the items still there :x

LUA:
function onStepIn(cid, item, frompos, item2, topos) 

local portal_in_pos = {x = 32477, y = 31758, z = 10}
local statue_in_pos = {x = 32476, y = 31758, z = 10}
local novapos = {x=32360, y = 31782, z = 7} 
local portal_iten_pos = getThingfromPos(portal_in_pos)
local statue_iten_pos = getThingfromPos(statue_in_pos) 

if item.actionid == 9023 then

getThingfromPos(getPlayerPosition(cid)) 
doSendMagicEffect(getPlayerPosition(cid),2) 
doTeleportThing(cid,novapos) 
doSendMagicEffect(novapos,10) 
doRemoveItem(portal_iten_pos.uid, 255)
doRemoveItem(statue_iten_pos.uid, 255)
end 
end

suggestions?
 
LUA:
--wrong
local statue_iten_pos = {x=32478,y=31758,z=10, stackpos=1}
doRemoveItem(statue_iten_pos.uid)


--best way (mean there is the get thing frompos way tooo
local statue_iten_pos = {x=32478,y=31758,z=10}
statueid  = 1234   --right statu id
doRemoveItem(getTileItemById(statue_iten_pos,statueid).uid))
 
Is there a way to create the statue again after x seconds?

-- edit --

nevermind, got it, adding
LUA:
doCreateItem(1476,{x=32478,y=31758,z=10})

when the player steps at portal, to leave the room

but I didn't manage to make the portal and other statue disappear, even using this method o.o, I'll keep trying here...
 
Last edited:
Back
Top