Hi, i need script npc learn spell, i try write script but dont work, i have only this, so can you help me? tfs 0.3.6
Code:
if getPlayerStorageValue(cid, 9996) == 1 then
selfSay("I can teach you: bla bla, bla bla, bla")
else
selfSay('Sorry, i can only teach only specific people.')
end
Code:
function spell(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerSkillLevel(cid, 6) >= 30 then
if getPlayerLearnedInstantSpell(cid, "spell") == false then
if getPlayerLevel(cid) >= 15 then
doPlayerLearnInstantSpell(cid, "spell")
else
selfSay("You are not level 15.", cid)
end
else
selfSay("You have already learned spell.", cid)
end
else
selfSay("You need to be level 30 in Fishing.", cid)
end
return true
end
Code:
local node1 = keywordHandler:addKeyword({'spell'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to learn spell?"})
node1:addChildKeyword({'yes'}, yes, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Are you an alienated!", reset = true})