• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Action id on key disapear on logout

Kisskotte

New Member
Joined
May 26, 2008
Messages
60
Reaction score
1
Hello have a problem with key's losing there action id on logout goes from example "32002" to "0" on logout getting a little anoying is it posible to fix this?
 
Try using:

LUA:
doPlayerSave(cid, true)
Place it within the script that adds the key, after the function that adds the key, NOT before.

Edit: You're using 0.2.12, it won't work...
 
Last edited:
Got an error bug.jpg


firekeybox.lua
Code:
local t = {
	[10621] = { -- Chest Action Id
		storage = 10621, -- Storage
		keyId = 2089, -- Key Item Id
		actionId = 32002 -- Key Action Id
	}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = t[item.actionid]
	if k then
		if getPlayerStorageValue(cid, k.storage) < 0 then
			local id = doCreateItemEx(k.keyId, 1)
			if doPlayerAddItemEx(cid, id) ~= RETURNVALUE_NOERROR then
				doPlayerSendCancel(cid, "You cannot carry this item.")
			else
				doSetItemActionId(id, k.actionId)
                      [COLOR="#FF0000"]doPlayerSave(cid, true)[/COLOR]
				setPlayerStorageValue(cid, k.storage, 1)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a " .. getItemName(k.keyId) .. "!")
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "The " .. getItemName(item.itemid) .. " is empty.")
		end
	end
	return true
end
 
open your rme
create a chest
set action id 2000 on chest
set unique id whatever you like - this will be your storage id
add key into chest
set action id on key
save the map
 
Back
Top