I have been working on a quest for the past couple of days where when you right click a tree there is a secret quest.
I've gotten to the point where the tree gives the key AID 1501 (You see a key (1501)), but now the key won't open the door 1501 saying "The key does not match."
in actions.xml I have -
(I know the quest name is 1500, but the door is in fact AID 1501)
In door1500.lua I have -
Any ideas what I did wrong?
I've gotten to the point where the tree gives the key AID 1501 (You see a key (1501)), but now the key won't open the door 1501 saying "The key does not match."
in actions.xml I have -
Code:
<action actionid="1500" script="quests/door1500.lua" />
(I know the quest name is 1500, but the door is in fact AID 1501)
In door1500.lua I have -
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey) --This is mostly used to state the script executes onUse (right-clicking an object)
if player:getStorageValue(storage) == -1 then --Here we just check if the Player has the storage value we mentioned before, -1 means that the player DOESN'T have the value
player:addItem(2087, 1):setActionId(1501)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a key hidden inside of the tree!") --This is just a message so the player knows something happened.
player:setStorageValue(storage, 1) --We set the storage value to 1
else --What happens if the value is already assigned to that player (He already received the reward)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Aside from some squirming larvae, there's nothing of interest here.") --Only shows this message
end
return true
end
Any ideas what I did wrong?