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

how to use doSetActionId

Ziggy

Member
Joined
Aug 11, 2007
Messages
49
Reaction score
6
alright here is my script

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local key = doPlayerAddItem(cid, 2089, 1)
    if item.uid == 20013 then
        if getPlayerStorageValue(cid, 20013) == 1 then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found the copper key to the mines, congratulations.")
			doPlayerAddItem(cid, key, 1)
		    doSetItemActionId(2089, 1042)
            setPlayerStorageValue(cid, 20013, 2)
        else
            doPlayerSendTextMessage(cid,25,"The chest is empty.")
        end
    end
end

It is adding the item but is not setting it to have the action id of 1042, the key id is 2089 by the way, the script (I found this script and just edited it) had "key" in place of that but it didnt seem to work so I switched it to the ID of the key

here is the error code im getting

Code:
[19/12/2010 17:05:46] [Error - Action Interface] 
[19/12/2010 17:05:46] data/actions/scripts/quests/copperkey.lua:onUse
[19/12/2010 17:05:46] Description: 
[19/12/2010 17:05:46] data/actions/scripts/quests/copperkey.lua:7: attempt to call global 'doSetItemActionId' (a nil value)
[19/12/2010 17:05:46] stack traceback:
[19/12/2010 17:05:46] 	data/actions/scripts/quests/copperkey.lua:7: in function <data/actions/scripts/quests/copperkey.lua:1>

In this script it doesnt seem to change the player storage value right away, I made the quest last night and it wouldnt change the storage value, it stayed at 1 forever, but the next day (today) for all three characters the storage value was 2, so it happened overnight?
 
Last edited:
Im pretty sure its
LUA:
doItemSetAttribute(item.uid,'uid',value)
or 'aid' for actionID
 
Last edited:
rep goes to you santigggg for showing me how to finally get it to work, now the script is all junky though and for some reason sometimes wont set the storage value to 2 until a minute or two later so you can get many keys and its making mountain borders and then mountain walls all around the player, any idea about that?
 
Btw, 1 is storage used, if you never got that storage to 1, then you shud put it as -1(which means storage not taken)
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 20013 then
   if getPlayerStorageValue(cid, 20013) == 1 then
      doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found the copper key to the mines, congratulations.")
      doItemSetAttribute(doPlayerAddItem(cid,2089,1), 'aid', 1042)
      setPlayerStorageValue(cid, 20013, 2)
   else
       doPlayerSendTextMessage(cid,25,"The chest is empty.")
   end
end
return true
end
 
Well I do quests so that they show up in the quest log when the player logs in (so if -1, set to 1 in login.lua) I do the -1 to 1 thing cuz all the quests start at storage 1, so my default storage is always 1 and i change it to 2 for the second part of a quest or the end of a short quest
 
Well I do quests so that they show up in the quest log when the player logs in (so if -1, set to 1 in login.lua) I do the -1 to 1 thing cuz all the quests start at storage 1, so my default storage is always 1 and i change it to 2 for the second part of a quest or the end of a short quest

Oh, alright, nvm then
 
Back
Top