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

onUse item destroy help please.

jixi

Complete Noob
Joined
Sep 5, 2010
Messages
25
Reaction score
0
I am using this script to make an on use item spawn a creature, the help i need is how to make the item delete its self after use. thank for the help.



Code:
   function onUse(cid, item, frompos, item2, topos)

local config = {monster = "demon"}

local dir = getPlayerLookDir(cid)
local pos = getPlayerPosition(cid)

if(dir==1)then
    pos.x = pos.x + 1
elseif(dir==2)then
    pos.y = pos.y + 1
elseif(dir==3)then
    pos.x = pos.x - 1
elseif(dir==0)then
    pos.y = pos.y - 1
end

if item.itemid == 2348 then
        doCreateMonster(config.monster, pos)
		
		
end

return LUA_NO_ERROR
end
 
Lua:
  function onUse(cid, item, frompos, item2, topos)

local config = {monster = "demon"}

local dir = getPlayerLookDir(cid)
local pos = getPlayerPosition(cid)

if(dir==1)then
    pos.x = pos.x + 1
elseif(dir==2)then
    pos.y = pos.y + 1
elseif(dir==3)then
    pos.x = pos.x - 1
elseif(dir==0)then
    pos.y = pos.y - 1
end

if item.itemid == 2348 then
        doCreateMonster(config.monster, pos)
        doRemoveItem(item.uid, 1)		
end
return LUA_NO_ERROR
end
 
OMG thank you so much! haha i figured the rest out it was jsut the remove item i didn't know how to do. thanks so much
 
Back
Top