The Forgotten Server, version 0.3.6 (Crying Damson)
8.6~~
Hello, i asked my scripter to make me a dual-promo npc, since i have made 2 new promotions for each voc. For example EK - Harbinger/juggernaught. Anyway to the problem. He made me this promoscript and sent it to me and now he has gone on a 3 week vacation. and it doesn't work. and i'm hopeless when it comes to this scripting stuff (a) so if someone could help me with it i would be really happy
And the servererror i get is
well i kinda figured that it's a "then" somewhere that is off. But maaan, there are like 10+ "thens" in the Script ): and as i mentioned earlier, my knowledge about these languages are 0 and if this won't work a script for a promoter from Vocid=8 to 12 Would be great to then i can just make 8 of them and modify them. Thanks in advance~~
p.s sorry if my english is pretty rusty.
8.6~~
Hello, i asked my scripter to make me a dual-promo npc, since i have made 2 new promotions for each voc. For example EK - Harbinger/juggernaught. Anyway to the problem. He made me this promoscript and sent it to me and now he has gone on a 3 week vacation. and it doesn't work. and i'm hopeless when it comes to this scripting stuff (a) so if someone could help me with it i would be really happy
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local Topic = {}
function creatureSayCallback(cid, type, msg)
if msgcontains(msg,'promotion') then
local v = getPlayerStorageValue(cid,100)
if v = 8 then
npcHandler:say('Is promotion really what you seek?',cid)
Topic[cid] = 1
elseif v > 8 then
npcHandler:say('You are already promoted a second time.',cid)
Topic[cid] = 0
end
elseif Topic[cid] == 1 then
if isElite Knight(cid) then
npcHandler:say('You have two paths to choose, you can be either {Juggernaught} or {Harbinger}, choose one.',cid)
Topic[cid] = 2
end
elseif Topic[cid] == 2 then
if isElite Knight(cid) then
if msgcontains(msg,'juggernaught') then
npcHandler:say('Are you sure about this?\nYour choice is irreversible!?',cid)
Topic[cid] = 3
elseif msgcontains(msg,'harbinger') then
npcHandler:say('Are you sure about this?\nYour choice is irreversible!?',cid)
Topic[cid] = 4
end
end
elseif Topic[cid] == 3 then
if isElite Knight(cid) then
if msgcontains(msg,'yes') then
doPlayerSetVocation(cid,12)
setPlayerStorageValue(cid,v,1)
npcHandler:say('You are now a {Juggernaught!}',cid)
Topic[cid] = 0
else
npcHandler:say('Then not.',cid)
Topic[cid] = 0
end
end
elseif Topic[cid] == 4 then
if isElite Knight(cid) then
if msgcontains(msg,'yes') then
doPlayerSetVocation(cid,16)
setPlayerStorageValue(cid,v,1)
npcHandler:say('You are now an {Harbinger}!',cid)
Topic[cid] = 0
else
npcHandler:say('Then not.',cid)
Topic[cid] = 0
end
end
end
end
npcHandler:setMessage(MESSAGE_WALKAWAY, "Argh, goodbye..")
npcHandler:setMessage(MESSAGE_FAREWELL, "Goodbye..")
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
And the servererror i get is
Code:
[Error - LuaScriptInterface::loadFile] data/npc/scripts/knightpromo.lua:13: 'then' expected near '='
[Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/knightpromo.lua
data/npc/scripts/knightpromo.lua:13: 'then' expected near '='
[Error - LuaScriptInterface::loadFile] data/npc/scripts/knightpromo.lua:13: 'then' expected near '='
[Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/knightpromo.lua
data/npc/scripts/knightpromo.lua:13: 'then' expected near '='
well i kinda figured that it's a "then" somewhere that is off. But maaan, there are like 10+ "thens" in the Script ): and as i mentioned earlier, my knowledge about these languages are 0 and if this won't work a script for a promoter from Vocid=8 to 12 Would be great to then i can just make 8 of them and modify them. Thanks in advance~~
p.s sorry if my english is pretty rusty.