• 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 Doll (Tfs 1.0)

God Mythera

Veteran OT User
Joined
Aug 11, 2012
Messages
2,051
Solutions
2
Reaction score
260
Location
United States
Hello, when i try to use mount doll on a new mount like "Floating Kashmir" it says "Retype, something is wrong!" can anyone maybe tell me what the problem is? Much appreciated!

Code:
local config = 
{ 
   --["mount"] = {id = x},
   ["widow queen"] = {id = 1},
   ["racing bird"] = {id = 2},
   ["war bear"] = {id = 3},
   ["black Sheep"] = {id = 4},
   ["midnight panther"] = {id = 5},
   ["draptor"] = {id = 6},
   ["titanica"] = {id = 7},
   ["tin lizzard"] = {id = 8},
   ["blazebringer"] = {id = 9},
   ["rapid boar"] = {id = 10},
   ["Stampor"] = {id = 11},
   ["undead cavebear"] = {id = 12},
   ["donkey"] = {id = 13},
   ["tiger slug"] = {id = 14},
   ["Uniwheel"] = {id = 15},
   ["crystal wolf"] = {id = 16},
   ["brown war horse"] = {id = 17},
   ["kingly deer"] = {id = 18},
   ["tamed panda"] = {id = 19},
   ["dromedary"] = {id = 20},
   ["king scorpion"] = {id = 21},
   ["rented horse a"] = {id = 22},
   ["armoured war horse"] = {id = 23},
   ["shadow draptor"] = {id = 24},
   ["rented horse b"] = {id = 25},
   ["rented horse c"] = {id = 26},
   ["ladybug"] = {id = 27},
   ["manta"] = {id = 28},
   ["ironblight"] = {id = 29},
   ["magma Crawler"] = {id = 30},
   ["dragonling"] = {id = 31},
   ["gnarlhound"] = {id = 32},
   ["crimson ray"] = {id = 33},
   ["Steelbeak"] = {id = 34},
   ["water buffalo"] = {id = 35},
   ["armoured scorpion"] = {id = 36},
   ["armoured dragonling"] = {id = 37},
   ["armoured cavebear"] = {id = 38},
   ["lion"] = {id = 40},
   ["Golden Lion"] = {id = 41},
   ["Shock Head"] = {id = 42},
   ["Walker"] = {id = 43},
   ["Azudocus"] = {id = 44},
   ["Carpacosaurus"] = {id = 45},
   ["Death Crawler"] = {id = 46},
   ["Flamesteed"] = {id = 47},
   ["Jade Lion"] = {id = 48},
   ["Jade Pincer"] = {id = 49},
   ["Nethersteed"] = {id = 50},
   ["Tempest"] = {id = 51},
   ["Winter King"] = {id = 52},
   ["Doombringer"] = {id = 53},
   ["Woodland Prince"] = {id = 54},
   ["Hailtorm Fury"] = {id = 55},
   ["Siegebreaker"] = {id = 56},
   ["Poisonbane"] = {id = 57},
   ["Blackpelt"] = {id = 58},
   ["Golden Dragonfly"] = {id = 59},
   ["Steel Bee"] = {id = 60},
   ["Copper Fly"] = {id = 61},
   ["Tundra Rambler"] = {id = 62},
   ["Highland Yak"] = {id = 63},
   ["Glacier Vagabond"] = {id = 64},
   ["Glooth Glider"] = {id = 65},
   ["Shadow Hart"] = {id = 66},
   ["Black Stag"] = {id = 67},
   ["Emperor Deer"] = {id = 68},
   ["Flying Divan"] = {id = 69},
   ["Magic Carpet"] = {id = 70},
   ["Floating Kashmir"] = {id = 71},
   ["Ringtail Waccoon"] = {id = 72},
   ["Night Waccoon"] = {id = 73},
   ["Emerald Waccoon"] = {id = 74},
   ["Flitterkatzen"] = {id = 75},
   ["Venompaw"] = {id = 76},
   ["Batcat"] = {id = 77},
   ["Sea Devil"] = {id = 78},
   ["Coralripper"] = {id = 79},
   ["Plumfish"] = {id = 80},
   ["Gorongra"] = {id = 81},
   ["Noctungra"] = {id = 82},
   ["Silverneck"] = {id = 83},
   ["Slagsnare"] = {id = 84},
   ["Nightstinger"] = {id = 85},
   ["Razorcreep"] = {id = 86}
}

function onSay(cid, words, param)

   local player, t, mountdoll_id = Player(cid), config[string.lower(param)], 13030 -- id do mount doll
   
   if (player:getItemCount(mountdoll_id) > 0) then
        if (param ~= "" and t) then
         if(t and not player:hasMount(t.id)) then  
            player:removeItem(mountdoll_id, 1)
                player:sendTextMessage(MESSAGE_INFO_DESCR, "Mount was added!")
            player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
            player:addMount(t.id)
            else
            player:sendCancelMessage("You already have this mount.")
            end
        else
         player:sendCancelMessage("Retype, something is wrong!")
        end
    else
      player:sendCancelMessage("You do not have a mount doll!")
    end

   return true
end
 
if(t and not player:hasMount(t.id)) then
is giving you the error
try adding
print(t, (not player:hasMount(t.id)) before it and seeing what prints in console
 
Last edited:
if you wont bother doing what i say in my post why should i bother trying to help you
I feel your frustration. :(
it shows no errors it only says "Retype, something is wrong!" :S
The answer is right in front of you, you have mixed string properties but the string modifier you are using makes each command you pass only 1 type.
 
if you wont bother doing what i say in my post why should i bother trying to help you
It's not that its that it doesnt show any error when typing for example '!mount "Floating Kashmir' there is no error to show ;d

The answer is right in front of you, you have mixed string properties but the string modifier you are using makes each command you pass only 1 type.
Can you explain please?
 
It's not that its that it doesnt show any error when typing for example '!mount "Floating Kashmir' there is no error to show ;d


Can you explain please?
It's pretty obvious you just copy and pasted the mount names and added them to the table but you over looked the way the code handles the commands and retrieves the id's.

I am not going to correct the code, but I will explain my previous statement.

onSay
passes 3 arguments to the script:
cid which is the player id, in your script you are passing it to Player to construct an instance of the player.
words is the command you use to execute the talk action
The argument "Floating Kashmir" is passed to param when you execute the talkaction.

I am sure you are thinking to yourself that "Floating Kashmir" matches the entry in the config table, and you are correct in that assumption.
However you have failed to review how the code retrieves data from the table.

An easy way to figure this out is to look for the next instance of param, where do you see it?
It is sitting in between 2 parentheses and to the left of it is 2 words with a dot connecting them, string.lower.
Code:
string.lower(param)

The way this function works is it takes the value stored in its argument in this case its param and if the value inside of param contains any capital letters it converts it to lowercase letters ( I am giving a general explanation).

This "Floating Kashmir" becomes this "floating kashmir", then it uses that value which it has converted and passes it to the config table, do you have a property in the config labeled "floating kashmir"?

No you do not.

If / else statements aren't there just for show, they exist to help you trouble shoot issues in the structure of the code.
In your script you have several if statements with accompanying else which help you determine where and why the code is not working.

Look at your error.
it shows no errors it only says "Retype, something is wrong!" :S
Where is the if statement which is associated with this else?
Code:
if (param ~= "" and t) then

What does that say?
if param does not equal an empty string and t has some type of value then do the next step.

If either one of those conditions are false then this if statement is skipped because of the logical operator and, and compares to see if both operands are true and if they are true then it returns true.

Find some time in the day to read up on this stuff. :)

If you have trouble with the language then ask for help of where you are stuck, a lot of us would love to teach any or all of you about lua not just write/edit scripts for the masses.

This is an important time in your lives where you can learn from others for free no less.
 
Last edited:
Is this what you was talking about?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<mounts>
    <mount id="1" clientid="368" name="Widow Queen" speed="20" premium="no" />
    <mount id="2" clientid="369" name="Racing Bird" speed="20" premium="no" />
    <mount id="3" clientid="370" name="War Bear" speed="20" premium="no" />
    <mount id="4" clientid="371" name="Black Sheep" speed="20" premium="no" />
    <mount id="5" clientid="372" name="Midnight Panther" speed="20" premium="no" />
    <mount id="6" clientid="373" name="Draptor" speed="20" premium="no" />
    <mount id="7" clientid="374" name="Titanica" speed="20" premium="no" />
    <mount id="8" clientid="375" name="Tin Lizzard" speed="20" premium="no" />
    <mount id="9" clientid="376" name="Blazebringer" speed="40" premium="no" />
    <mount id="10" clientid="377" name="Rapid Boar" speed="20" premium="no" />
    <mount id="11" clientid="378" name="Stampor" speed="20" premium="no" />
    <mount id="12" clientid="379" name="Undead Cavebear" speed="20" premium="no" />
    <mount id="13" clientid="387" name="Donkey" speed="20" premium="no" />
    <mount id="14" clientid="388" name="Tiger Slug" speed="20" premium="no" />
    <mount id="15" clientid="389" name="Uniwheel" speed="20" premium="no" />
    <mount id="16" clientid="390" name="Crystal Wolf" speed="40" premium="no" />
    <mount id="17" clientid="392" name="Brown War Horse" speed="20" premium="no" />
    <mount id="18" clientid="401" name="Kingly Deer" speed="20" premium="no" />
    <mount id="19" clientid="402" name="Tamed Panda" speed="20" premium="no" />
    <mount id="20" clientid="405" name="Dromedary" speed="20" premium="no" />
    <mount id="21" clientid="406" name="King Scorpion" speed="20" premium="no" />
    <mount id="22" clientid="421" name="Rented Horse" speed="20" premium="no" />
    <mount id="23" clientid="426" name="Armoured War Horse" speed="20" premium="no" />
    <mount id="24" clientid="427" name="Shadow Draptor" speed="20" premium="no" />
    <mount id="25" clientid="437" name="Rented Horse" speed="20" premium="no" />
    <mount id="26" clientid="438" name="Rented Horse" speed="20" premium="no" />
    <mount id="27" clientid="447" name="Ladybug" speed="20" premium="no" />
    <mount id="28" clientid="450" name="Manta" speed="20" premium="no" />
    <mount id="29" clientid="502" name="Ironblight" speed="20" premium="no" />
    <mount id="30" clientid="503" name="Magma Crawler" speed="20" premium="no" />
    <mount id="31" clientid="506" name="Dragonling" speed="40" premium="no" />
    <mount id="32" clientid="515" name="Gnarlhound" speed="20" premium="no" />
    <mount id="33" clientid="521" name="Crimson Ray" speed="20" premium="no" />
    <mount id="34" clientid="522" name="Steelbeak" speed="20" premium="no" />
    <mount id="35" clientid="526" name="Water Buffalo" speed="20" premium="no" />
    <mount id="36" clientid="546" name="Armoured Scorpion" speed="20" premium="no" />
    <mount id="37" clientid="547" name="Armoured Dragonling" speed="20" premium="no" />
    <mount id="38" clientid="548" name="Armoured Cavebear" speed="20" premium="no" />
    <mount id="39" clientid="559" name="The Hellgrip" speed="20" premium="no" />
    <mount id="40" clientid="571" name="Lion" speed="20" premium="no" />
    <mount id="41" clientid="572" name="Golden Lion" speed="40" premium="no" />
    <mount id="42" clientid="580" name="Shock Head" speed="20" premium="no" />
    <mount id="43" clientid="606" name="Walker" speed="20" premium="no" />
    <mount id="44" clientid="621" name="Azudocus" speed="20" premium="no" />
    <mount id="45" clientid="622" name="Carpacosaurus" speed="20" premium="no" />
    <mount id="46" clientid="624" name="Death Crawler" speed="20" premium="no" />
    <mount id="47" clientid="626" name="Flamesteed" speed="20" premium="no" />
    <mount id="48" clientid="627" name="Jade Lion" speed="20" premium="no" />
    <mount id="49" clientid="628" name="Jade Pincer" speed="20" premium="no" />
    <mount id="50" clientid="629" name="Nethersteed" speed="20" premium="no" />
    <mount id="51" clientid="630" name="Tempest" speed="20" premium="no" />
    <mount id="52" clientid="631" name="Winter King" speed="20" premium="no" />
    <mount id="53" clientid="644" name="Doombringer" speed="20" premium="no" />
    <mount id="54" clientid="647" name="Woodland Prince" speed="20" premium="no" />
    <mount id="55" clientid="648" name="Hailtorm Fury" speed="20" premium="no" />
    <mount id="56" clientid="649" name="Siegebreaker" speed="20" premium="no" />
    <mount id="57" clientid="650" name="Poisonbane" speed="20" premium="no" />
    <mount id="58" clientid="651" name="Blackpelt" speed="20" premium="no" />
    <mount id="59" clientid="669" name="Golden Dragonfly" speed="20" premium="no" />
    <mount id="60" clientid="670" name="Steel Bee" speed="20" premium="no" />
    <mount id="61" clientid="671" name="Copper Fly" speed="20" premium="no" />
    <mount id="62" clientid="672" name="Tundra Rambler" speed="20" premium="no" />
    <mount id="63" clientid="673" name="Highland Yak" speed="20" premium="no" />
    <mount id="64" clientid="674" name="Glacier Vagabond" speed="20" premium="no" />
    <mount id="65" clientid="682" name="Glooth Glider" speed="20" premium="no" />
    <mount id="66" clientid="685" name="Shadow Hart" speed="20" premium="no" />
    <mount id="67" clientid="686" name="Black Stag" speed="20" premium="no" />
    <mount id="68" clientid="687" name="Emperor Deer" speed="20" premium="no" />
    <mount id="69" clientid="688" name="Flying Divan" speed="20" premium="no" />
    <mount id="70" clientid="689" name="Magic Carpet" speed="20" premium="no" />
    <mount id="71" clientid="690" name="Floating Kashmir" speed="20" premium="no" />
    <mount id="72" clientid="691" name="Ringtail Waccoon" speed="20" premium="no" />
    <mount id="73" clientid="692" name="Night Waccoon" speed="20" premium="no" />
    <mount id="74" clientid="693" name="Emerald Waccoon" speed="20" premium="no" />
    <mount id="75" clientid="726" name="Flitterkatzen" speed="20" premium="no" />
    <mount id="76" clientid="727" name="Venompaw" speed="20" premium="no" />
    <mount id="77" clientid="728" name="Batcat" speed="20" premium="no" />
    <mount id="78" clientid="734" name="Sea Devil" speed="20" premium="no" />
    <mount id="79" clientid="735" name="Coralripper" speed="20" premium="no" />
    <mount id="80" clientid="736" name="Plumfish" speed="20" premium="no" />
    <mount id="81" clientid="738" name="Gorongra" speed="20" premium="no" />
    <mount id="82" clientid="739" name="Noctungra" speed="20" premium="no" />
    <mount id="83" clientid="740" name="Silverneck" speed="20" premium="no" />
    <mount id="84" clientid="761" name="Slagsnare" speed="20" premium="no" />
    <mount id="85" clientid="762" name="Nightstinger" speed="20" premium="no" />
    <mount id="86" clientid="763" name="Razorcreep" speed="20" premium="no" />   
    <mount id="87" clientid="121" name="Hydra" speed="100" premium="no" />   
    <mount id="88" clientid="414" name="Thornfire Wolf" speed="100" premium="no" />
    <mount id="89" clientid="317" name="Young Sea Serpent" speed="100" premium="no" />
</mounts>
 

Similar threads

Back
Top