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

when use right click on item it doesn't dissapear

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
921
Location
Chile
hiii, how are you people of otland, well i'm here because i have this problem...i have a frag remover item, but when i use it it doesn't dissapear...how can i do to make it dissapear after using it? D:, here is the lua in actions

Lua:
local skulls,s = {SKULL_YELLOW = "yellow", SKULL_GREEN = "green", SKULL_WHITE = "white"},50000
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local txt = "Your " .. (getCreatureSkullType(cid) == SKULL_NONE and "don't have any" or "can't") .. " " .. (getCreatureSkullType(cid) == skulls[1] and skulls[2] or "") .. " skull!"
	if getCreatureSkullType(cid) == skulls[1] then return doPlayerSendTextMessage(cid, 27, txt) end
		if getPlayerStorageValue(cid,s) < 1 then
			doCreatureSetSkullType(cid, SKULL_NONE)
			doPlayerSendTextMessage(cid, 27, (getCreatureSkullType(cid) == SKULL_RED and "Red" or "Black") .. " skull has been removed!")
			db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
		else
			doPlayerSendCancel(cid,'You can only use this once.')
		end
	return true
end
 
Code:
local skulls,s = {SKULL_YELLOW = "yellow", SKULL_GREEN = "green", SKULL_WHITE = "white"},50000
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local txt = "Your " .. (getCreatureSkullType(cid) == SKULL_NONE and "don't have any" or "can't") .. " " .. (getCreatureSkullType(cid) == skulls[1] and skulls[2] or "") .. " skull!"
	if getCreatureSkullType(cid) == skulls[1] then return doPlayerSendTextMessage(cid, 27, txt) end
		if getPlayerStorageValue(cid,s) < 1 then
			doCreatureSetSkullType(cid, SKULL_NONE)
			doPlayerSendTextMessage(cid, 27, (getCreatureSkullType(cid) == SKULL_RED and "Red" or "Black") .. " skull has been removed!")
			db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
                        doRemoveItem(cid, item)
		else
			doPlayerSendCancel(cid,'You can only use this once.')
		end
	return true
end
 
Lua:
local skulls,s = {SKULL_YELLOW = "yellow", SKULL_GREEN = "green", SKULL_WHITE = "white"},50000
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local txt = "Your " .. (getCreatureSkullType(cid) == SKULL_NONE and "don't have any" or "can't") .. " " .. (getCreatureSkullType(cid) == skulls[1] and skulls[2] or "") .. " skull!"
	if getCreatureSkullType(cid) == skulls[1] then return doPlayerSendTextMessage(cid, 27, txt) end
		if getPlayerStorageValue(cid,s) < 1 then
			doCreatureSetSkullType(cid, SKULL_NONE)
			doPlayerSendTextMessage(cid, 27, (getCreatureSkullType(cid) == SKULL_RED and "Red" or "Black") .. " skull has been removed!")
                        doRemoveItem(item.uid, 1)
			db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
		else
			doPlayerSendCancel(cid,'You can only use this once.')
		end
	return true
end
 
Back
Top