• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Mount seller problem .

Mysticots

New Member
Joined
Sep 19, 2012
Messages
52
Reaction score
0
Error.
Code:
[22/09/2012 15:46:13] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/mountseller.lua
[22/09/2012 15:46:13] data/npc/scripts/mountseller.lua:14: '}' expected (to close '{' at line 1) near '['

Script.
Code:
local table = {
    ["Widow Queen"] = {price = 0, id = 1}, 
    ["Racing Bird"] = {price = 0, id = 2}, 
    ["War Bear"] = {price = 0, id = 3}, 
    ["Black Sheep"] = {price = 0, id = 4}, 
    ["Midnight Panther"] = {price = 0, id = 5}, 
    ["Draptor"] = {price = 0, id = 6}, 
    ["Titanica"] = {price = 0, id = 7}, 
    ["Tin Lizzard"] = {price = 0, id = 8}, 
    ["Blazebringer"] = {price = 0, id = 9}, 
    ["Rapid Boar"] = {price = 0, id = 10}, 
    ["Stampor"] = {price = 0, id = 11}, 
    ["Undead Cavebear"] = {price = 0, id = 12} 
    ["Mule"] = {price = 0, id = 13}
    ["Tiger Slug"] = {price = 0, id = 14}
    ["Uniwheel"] = {price = 0, id = 15}
    ["Crystal Wolf"] = {price = 0, id = 16}
    ["War Horse"] = {price = 0, id = 17}
    ["Kingly Deer"] = {price = 0, id = 18}
    ["Tamed Panda"] = {price = 0, id = 19}
    ["Dramedary"] = {price = 0, id = 20}
    ["Sandstone Scorion"] = {price = 0, id = 21}
    ["Rented Horse 1"] = {price = 0, id = 22}
    ["Fire War Horse"] = {price = 0, id = 23}
    ["Shadow Draptor"] = {price = 0, id = 24}
    ["Rented Horse 2"] = {price = 0, id = 25}
    ["Rented Horse 3"] = {price = 0, id = 26}
    ["Ladybug"] = {price = 0, id = 27}
    ["Manta"] = {price = 0, id = 28}
    ["Ironblight"] = {price = 0, id = 29}
    ["Magma Crawler"] = {price = 0, id = 30}
    ["Dragonling"] = {price = 0, id = 31}
    ["Gnarlhound"] = {price = 0, id = 32}
} 
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.cena) 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 told me a correct name of mount!', cid) 
    talkState[talkUser] = 0 
   end 
   return true 
end 

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

Idk whats wrong ,. Hope some of you know ...
 
LUA:
local table = {
    ["Widow Queen"] = {price = 0, id = 1}, 
    ["Racing Bird"] = {price = 0, id = 2}, 
    ["War Bear"] = {price = 0, id = 3}, 
    ["Black Sheep"] = {price = 0, id = 4}, 
    ["Midnight Panther"] = {price = 0, id = 5}, 
    ["Draptor"] = {price = 0, id = 6}, 
    ["Titanica"] = {price = 0, id = 7}, 
    ["Tin Lizzard"] = {price = 0, id = 8}, 
    ["Blazebringer"] = {price = 0, id = 9}, 
    ["Rapid Boar"] = {price = 0, id = 10}, 
    ["Stampor"] = {price = 0, id = 11}, 
    ["Undead Cavebear"] = {price = 0, id = 12} ,
    ["Mule"] = {price = 0, id = 13},
    ["Tiger Slug"] = {price = 0, id = 14},
    ["Uniwheel"] = {price = 0, id = 15},
    ["Crystal Wolf"] = {price = 0, id = 16},
    ["War Horse"] = {price = 0, id = 17},
    ["Kingly Deer"] = {price = 0, id = 18},
    ["Tamed Panda"] = {price = 0, id = 19},
    ["Dramedary"] = {price = 0, id = 20},
    ["Sandstone Scorion"] = {price = 0, id = 21},
    ["Rented Horse 1"] = {price = 0, id = 22},
    ["Fire War Horse"] = {price = 0, id = 23},
    ["Shadow Draptor"] = {price = 0, id = 24},
    ["Rented Horse 2"] = {price = 0, id = 25},
    ["Rented Horse 3"] = {price = 0, id = 26},
    ["Ladybug"] = {price = 0, id = 27},
    ["Manta"] = {price = 0, id = 28},
    ["Ironblight"] = {price = 0, id = 29},
    ["Magma Crawler"] = {price = 0, id = 30},
    ["Dragonling"] = {price = 0, id = 31},
    ["Gnarlhound"] = {price = 0, id = 32}
} 
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.cena) 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 told me a correct name of mount!', cid) 
    talkState[talkUser] = 0 
   end 
   return true 
end 

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