charlyhustle
Member
- Joined
- Dec 9, 2011
- Messages
- 47
- Reaction score
- 6
Hi guys,
I wrote a script for a quest but I'm struggling with getting it to work.
Here's what i did:
movements.xml:
script.lua:
The reason I did it this way is because I got multiple tiles that should trigger the first and second message.
I'm neither getting an error in the console nor does it show any message or anything else.
I think there might even be a better solution to achieve what i want?
Thanks in advance!
I wrote a script for a quest but I'm struggling with getting it to work.
Here's what i did:
movements.xml:
XML:
<movevent event="StepIn" actionid="56000" script="script.lua" />
script.lua:
Lua:
function onStepIn(creature, item, position, fromPosition)
local player = Player(creature)
if not player then creature:teleportTo(fromPosition) return true end
if item.itemid == 8426 then
if player:getStorageValue(quest) < 2 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "some text")
end
elseif item.itemid == 459 then
if player:getStorageValue(quest) == -1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "some more text")
player:setStorageValue(quest, 0)
end
elseif item.itemid == 19744 --to reset storage for testing purposes
player:setStorageValue(quest, -1)
end
return true
end
The reason I did it this way is because I got multiple tiles that should trigger the first and second message.
I'm neither getting an error in the console nor does it show any message or anything else.
I think there might even be a better solution to achieve what i want?
Thanks in advance!