Fruity
Scripter
Hello, I am working on a chain quest npc and I want to ask other scripters out there if my code is currently working.
Because my real computer broke down so I'm doing all this on a laptop without the power to even host a local server.
Does this work? Thank you for any help and feedback.
Because my real computer broke down so I'm doing all this on a laptop without the power to even host a local server.
Code:
-- 1
"Ah, thank you for helping me out! Bring me 10 pieces of green cloth."
-- 2
"You got my 10 pieces of green cloth yet?"
-- 3
"Thank you very much, do you mind bringing me 10 pieces of red cloth too? Say 'done' when you got them."
-- 4
"You got my 10 pieces of red cloth yet?"
-- 5
"Thank you very much, do you mind bringing me 10 pieces of white cloth too? Say 'done' when you got them."
-- 6
"You got my 10 pieces of white cloth yet?"
-- 7
"Thank you! You have finished all my quests."
-- 8
"You have already finished all my quests."
-- 9
"Sorry, please come back when you have my green cloths."
-- 10
"Sorry, please come back when you have my red cloths."
-- 11
"Sorry, please come back when you have my white cloths."
-- 12
}
if(getPlayerStorageValue(cid,603) > 0) then
selfSay(npc_message[8])
elseif(getPlayerStorageValue(cid,602) > 0) then
selfSay(npc_message[6])
if(msgcontains(msg, 'yes')) then
if(doPlayerRemoveItem(cid,WHITEID,10)) then
selfsay(npc_message[7]
setPlayerStorageValue(cid,603,1)
else
selfSay(npc_message[12])
end
end
elseif(getPlayerStorageValue(cid,601) > 0) then
selfSay(npc_message[4])
if(msgconatins(msg, 'yes')) then
if(doPlayerRemoveItem(cid,REDID,10)) then
selfsay(npc_message[5])
setPlayerStorageValue(cid,602,1)
else
selfSay(npc_message[11])
end
end
elseif(getPlayerStorageValue(cid,600) > 0) then
selfSay(npc_message[2])
if(msgconatins(msg, 'yes')) then
if(doPlayerRemoveItem(cid,GREENID,10)) then
selfsay(npc_message[2])
setPlayerStorageValue(cid,601,1)
else
selfSay(npc_message[10])
end
end
else
selfSay(npc_message[1])
setPlayerStorageValue(cid,600,1)
end
Does this work? Thank you for any help and feedback.