• 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!

Change mount looktype talkaction

Decodde

New Member
Joined
Oct 8, 2018
Messages
31
Reaction score
0
Hi would like request a talkaction like /looktype 99 but for mounts.

/mounttype 30

otclient_2018-11-27_14-40-02.png

Then it would change my actual mount to looktype 30 :p (30= spider looktype)

otclient_2018-11-27_14-40-28.png
 
Assuming you're using 1.x, copy and paste creaturescripts/scripts/looktype.lua and change
Code:
playerOutfit.lookType = lookTyoe
to
Code:
playerOutfit.lookMount = lookMount

Also, change the table for invalid mounts, or remove it if there are no invalid mounts.
Also change the limits in the condition, I'm not sure what are the mount limits
 
Yes i'm using tfs 1.3 sorry forgot to say.
I dont have looktype.lua in creaturescripts i do have it in talkactions.

I tried what you say:
talkactions.xml
Code:
    <talkaction words="/mounttype" separator=" " script="new/mounttype.lua" />

mounttype.lua
Code:
-- keep it ordered
local invalidTypes = {
    1, 135, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
    174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
    189, 190, 191, 411, 415, 424, 439, 440, 468, 469, 474, 475, 476, 477, 478,
    479, 480, 481, 482, 483, 484, 485, 501, 518, 519, 520, 524, 525, 536, 543,
    549, 576, 581, 582, 597, 616, 623, 625, 638, 639, 640, 641, 642, 643, 645,
    646, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663
}

function onSay(player, words, param)
 
    if not player:getGroup():getAccess() then
      return true
    end

    local lookType = tonumber(param)
    if lookType >= 0 and lookType < 2700 and not table.contains(invalidTypes, lookType) then
        local playerOutfit = player:getOutfit()
        playerOutfit.lookMount = lookMount
        player:setOutfit(playerOutfit)
    else
        player:sendCancelMessage("A look type with that id does not exist.")
    end
    return false
end

When i use /mounttype 20 while mounting it just remove my actual mount.
 
Last edited:
it's just a variable name lol
it holds the number which you pass
either change the variable name to lookMount or keep using lookType as the variable name and assign playerOutfit.lookMount to that variable
 
You used the code i posted?
yes and i tried it too, works fine if you replace the variable name like i said
i don't know all the mounts that debug so be careful with this, look in mounts.xml + there's some that aren't listed there that you'll have to watch out for
if you use an invalid mount id you'll debug
Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
      return true
    end
    local lookMount = tonumber(param)
    if lookMount then
        local playerOutfit = player:getOutfit()
        playerOutfit.lookMount = lookMount
        player:setOutfit(playerOutfit)
    end
    return false
end
 
yes and i tried it too, works fine if you replace the variable name like i said
i don't know all the mounts that debug so be careful with this, look in mounts.xml + there's some that aren't listed there that you'll have to watch out for
if you use an invalid mount id you'll debug
Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
      return true
    end
    local lookMount = tonumber(param)
    if lookMount then
        local playerOutfit = player:getOutfit()
        playerOutfit.lookMount = lookMount
        player:setOutfit(playerOutfit)
    end
    return false
end
Im using this code you post but each time i use the talkaction it remove my mount instead change, when you tested it was using otclient?
 
Back
Top