function onUse(cid, item, frompos, item2, topos)
if item.actionid == xxxx then
if getPlayerStorageValue(cid, xxxx) < 1 then
key = doPlayerAddItem(cid, xxxx, 1)
doSetItemActionId(key, xxxx)
end
end
end
function onUse(cid, item, frompos, item2, topos)
local config = {
storage = 5689, -- change to your own storage value :)
key = 5555, -- put your key id.
itemActionId = 4556 -- the action id on the key
}
if getPlayerStorageValue(cid, config.storage) == -1 then
setPlayerStorageValue(cid, config.storage, 1)
key = doPlayerAddItem(cid, config.key, 1)
doSetItemActionId(key, itemActionId)
else
doPlayerSendCancel(cid, "You have already received this key")
end
return TRUE
end
function onUse(cid, item, frompos, item2, topos)
local config = {
key = 5555, -- put your key id.
itemActionId = 4556 -- the action id on the key
}
key = doPlayerAddItem(cid, config.key, 1)
doSetItemActionId(key, itemActionId)
return TRUE
end
<action actionid="ACTION ID HERE!" script="lever12.lua" />
function onUse(cid, item, frompos, item2, topos)
local config = {
storage = 5689, -- change to your own storage value :)
key = 5555, -- put your key id.
itemActionId = 4556 -- the action id on the key
}
if getPlayerStorageValue(cid, config.storage) == -1 then
setPlayerStorageValue(cid, config.storage, 1)
key = doPlayerAddItem(cid, config.key, 1)
doSetItemActionId(key, itemActionId)
else
doPlayerSendCancel(cid, "You have already received this key")
end
return TRUE
end
<action actionid="2000" event="script" value="quests/fibula.lua" />
local config = {
storage = 1343,
key_id = 2090 -- Key ID
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) == -1 then
setPlayerStorageValue(cid, config.storage, 1)
key = doPlayerAddItem(cid, config.key_id, 1)
doSetItemActionId(key, 3244)
else
doPlayerSendCancel(cid, "You have already received this key.")
end
end
[13/06/2009 17:13:21] data/actions/scripts/quests/system.lua:4: unexpected symbol near '{'
[13/06/2009 17:13:21] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/fibula.lua)
[13/06/2009 17:13:21] data/actions/scripts/fibula.lua:9: ')' expected near 'config'
local config = {
storage = 1343,
key_id = 2090 -- Key ID
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) == -1 then
setPlayerStorageValue(cid, config.storage, 1)
key = doPlayerAddItem(cid, config.key_id, 1)
doSetItemActionId(key, 3244)
else
doPlayerSendCancel(cid, "You have already received this key.")
end
end
<action actionid="34908" event="script" value="fibula.lua" />
@Metal,
Copy the script from above.
I fixed it.
You can edit this number.
Lua:doSetItemActionId(key, 3244)