gritness
Member
- Joined
- May 26, 2021
- Messages
- 33
- Reaction score
- 6
Hey Guys,
i got a problem with checking storage by npc, always when player send keywords run else option as if player has not required storage.
little description about situation:
i made quest when player can get access to speciall location (getPlayerStorageValue(cid,allow_to_elementaris) )
after get a specific storage player can sail to new location, but if condition dont work :/
code bellow :
result of talk to action script
i got a problem with checking storage by npc, always when player send keywords run else option as if player has not required storage.
little description about situation:
i made quest when player can get access to speciall location (getPlayerStorageValue(cid,allow_to_elementaris) )
after get a specific storage player can sail to new location, but if condition dont work :/
code bellow :
Lua:
local allow_to_elementaris = 10052
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
local travelNode = keywordHandler:addKeyword({'yala'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Yala for 0 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1267, y=1191, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
if getPlayerStorageValue(cid,allow_to_elementaris) == 2 then
local travelNode = keywordHandler:addKeyword({'elementaris'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Elementaris for 0 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=837, y=545, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
else
local travelNode = keywordHandler:addKeyword({'elementaris'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You need a speciall {access} to sail to Elementaris '})
travelNode:addChildKeyword({'access'}, StdModule.say, {npcHandler = npcHandler, text = 'For gain allow to Elementaris complete mission The Glorious Citizen. Firstly you should talk to Warrior of Ethno'})
end
npcHandler:addModule(FocusModule:new())
Lua:
(player:sendTextMessage(MESSAGE_INFO_DESCR,"Allow To Elementaris = ".. player:getStorageValue(allow_to_elementaris)))
Attachments
-
ss.JPG13.7 KB · Views: 4 · VirusTotal
Last edited: