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

Quest~

SasirO

Banned User
Joined
Apr 30, 2009
Messages
559
Reaction score
0
Greetings, i need a script so if a player click on a hole then he'll get a key with an action id..

Anyone know how to make it?, i've looked everywhere and couldnt find any similar script, thanks in advance _/
 
Code:
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
 
This one is with storage(quest only 1 time) please the action id or uid, put it on the action.xml...
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


This is without storage(they can quest it how many times they want.
Lua:
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
 
This script isnt working for me, have you checked it before posting?
Im not getting any errors in the console, just nothing is happening to me.
 
But i dont got any chest or such, i got a small hole in my map id:385

i putted action id 2000 on it
and heres my script:
Code:
  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

Code:
<action actionid="2000" event="script" value="quests/fibula.lua" />
 
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

Tested and Works 100%.
 
Last edited:
@Metal,

Copy the script from above.
I fixed it.

You can edit this number.
Lua:
doSetItemActionId(key, 3244)
 
@up
isnt working, i already told ya, theres a small hole in the map with action id "34908"
PHP:
[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'
 
Copy it again,
I just used it...

11:22 You see a crystal key (Key:3244).
It weighs 1.00 oz.
ItemID: [2090], ActionID: [3244].
 
huh, still not working for me,
Actiond Id on the hole 34908
Code:
  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


PHP:
<action actionid="34908" event="script" value="fibula.lua" />
 
Back
Top