• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Mount seller NPC problem.

Paush

New Member
Joined
Oct 6, 2011
Messages
11
Reaction score
0
Hello everyone, Im having a problem with getting this Mount seller npc to work
im running TFS 0.2.11pl2 Mystic spirit and im getting this:
erroror.jpg

For this:

PHP:
local table = {
    ["Widow Queen"] = {price = 100000, id = 1}, 
    ["Racing Bird"] = {price = 100000, id = 2}, 
    ["War Bear"] = {price = 100000, id = 3}, 
    ["Black Sheep"] = {price = 5000, id = 4}, 
    ["Midnight Panther"] = {price = 300000, id = 5}, 
    ["Draptor"] = {price = 100000, id = 6}, 
    ["Titanica"] = {price = 100000, id = 7}, 
    ["Tin Lizzard"] = {price = 100000, id = 8}, 
    ["Blazebringer"] = {price = 100000, id = 9}, 
    ["Rapid Boar"] = {price = 100000, id = 10}, 
    ["Stampor"] = {price = 100000, id = 11}, 
    ["Undead Cavebear"] = {price = 500000, id = 12} 
    ["Mule"] = {price = 10000, id = 13}
    ["Tiger Slug"] = {price = 100000, id = 14}
    ["Uniwheel"] = {price = 200000, id = 15}
    ["Crystal Wolf"] = {price = 100000, id = 16}
    ["Brown War Horse"] = {price = 10000, id = 17}
    ["Kingly Deer"] = {price = 100000, id = 18}
    ["Tamed Panda"] = {price = 100000, id = 19}
    ["Dromedary"] = {price = 10000, id = 20}
    ["Sandstone Scorpion"] = {price = 500000, id = 21}
    ["Rented Horse"] = {price = 5000, id = 22}
    ["Fire War Horse"] = {price = 20000, id = 23}
} 
local keywordHandler = KeywordHandler:new() 
local npcHandler = NpcHandler:new(keywordHandler) 
NpcSystem.parseParameters(npcHandler) 
local talkState = {} 

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 

function creatureSayCallback(cid, type, msg) 
    if(not npcHandler:isFocused(cid)) then 
        return false 
    end 

    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid 
     if table[msg] then 
      local t = table[msg] 
      talkState[talkUser] = 1 
       if getPlayerPremiumDays(cid) >= 1 then 
        if not getPlayerMount(cid, t.id) then 
         if doPlayerRemoveMoney(cid, t.price) then 
          doPlayerAddMount(cid, t.id) 
          selfSay("You lost "..t.price.." gp! for mount!", cid) 
          talkState[talkUser] = 0 
         else 
          selfSay("Sorry, you do not have enough money!", cid) 
          talkState[talkUser] = 0 
         end 
        else 
         selfSay("You already have this mount!", cid) 
         talkState[talkUser] = 0 
        end 
       else 
        selfSay("You must be Premium!", cid) 
        talkState[talkUser] = 0 
       end 
    else 
    selfSay('What? Please give me the correct mount name!', cid) 
    talkState[talkUser] = 0 
   end 
   return true 
end 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())

Also, if there is nothing wrong with the script and its just my version then could you help me make it work for 9.1? Thank you.
 
Last edited:
Back
Top