Ezzz
Developer of Nostalrius and The Violet Project
Hey,
i'm trying to interpret a LUA npc scripting system, but I can't seem to be allowed to do this.
This is pretty much how my code looks like;
That piece of code is inside onCreatureSay function, however whenever the player speaks it will trigger any function that is inside. How can I skip this?, I'm actually trying to reproduce Cip NPC Files scripting and somekind of revscriptsys npc scripting aswell.
Help me please!
- - - Updated - - -
NVM i fixed it;
i'm trying to interpret a LUA npc scripting system, but I can't seem to be allowed to do this.
This is pretty much how my code looks like;
LUA:
function onCreatureSay(cid, type, msg)
Address = {
-- { {"key1|key2|...", {booleans} }, { functions or booleans}, {texts} }
{ {"hello|hi", {false} }, { selfSay("nop"), false }, {"Hello there, " .. getCreatureName(cid) } }
}
if getDistanceToCreature(cid) <= 3 then
for id, Adr in ipairs(Address) do
if isMsg(Adr[1][1], msg) then
for x, curBool in ipairs(Adr[1][2]) do
if curBool == false then
return false -- suposed to exit
end
end
Say(Adr[3][1])
end
end--end loop
end
end
That piece of code is inside onCreatureSay function, however whenever the player speaks it will trigger any function that is inside. How can I skip this?, I'm actually trying to reproduce Cip NPC Files scripting and somekind of revscriptsys npc scripting aswell.
Help me please!
- - - Updated - - -
NVM i fixed it;
Code:
Address = {
-- { {"key1|key2|...", {booleans} }, { functions or booleans}, { {text, delay} } }
{ {"hello|hi", { (getNpcFocus() == 0)} }, { AddFocus=cid, EffectOpp=11 }, { {"Hello there, " .. getCreatureName(cid), 1000} } },
{ {"hello|hi", { (getNpcFocus() ~= cid) } }, { Queue=cid }, { {"Hang on a moment, " .. getCreatureName(cid), 1000} } }
}
Last edited: