Tbol
Well-Known Member
- Joined
- Apr 7, 2019
- Messages
- 529
- Reaction score
- 56
Hello, trying to add storage check if player dont have storage X, npc would send message "You have to do blalbalbla first" and if he do have X storage everything would go like normal.
so i created local like
its not full config but it gives a sample
then im doing this which doesnt work
so as you can see trying to add getstoragevalue if he doesnt have that storage it sends npcHandler:say("You have to finish previous missions first!", cid) but if he does have it sends
npcHandler:say("Hello, " .. player:getName() .. ". test mission: " .. getRanksString() .. ".", cid)
npcHandler.topic[cid] = 0
but my shit doesnt work
so i created local like
Lua:
local testMission = {
[1] = {
rankName = "test",
mainStorage = 13251,
needstorage = 13250,
then im doing this which doesnt work
Lua:
function creatureSayCallback(cid, type, msg)
local player = Player(cid)
local vocationId = player:getVocation():getId()
if not npcHandler:isFocused(cid) then
if msg == "hi" or msg == "hello" then
npcHandler:addFocus(cid)
if player:getStorageValue(testMission.needstorage) then
npcHandler:say("Hello, " .. player:getName() .. ". test mission: " .. getRanksString() .. ".", cid)
npcHandler.topic[cid] = 0
else
npcHandler:say("You have to finish previous missions first!", cid)
end
else
return false
end
end
npcHandler:say("Hello, " .. player:getName() .. ". test mission: " .. getRanksString() .. ".", cid)
npcHandler.topic[cid] = 0
but my shit doesnt work