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

Tfs 1.2 Mount box does give owned mounts

Joriku

Working in the mines, need something?
Premium User
Joined
Jul 16, 2016
Messages
1,140
Solutions
15
Reaction score
431
Location
Sweden
So, i've been trying to make an mount box script, itemid 11402

scrip:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local mountid = math.random(43,103) -- you have to change 32 for your highest mount id
doPlayerAddMount(cid, mountid) --add the mount
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED) --effect on player
doRemoveItem(item.uid, 1) -- remove the item
return TRUE
end
it do give the mounts i want, but it do eaven give owned mounts if rolled that id
 
First of all, read the rules;
#7 Rules for the Support board
How to display CODE properly in your post

The function you need is Player:hasMount(id), what you can do is add a loop to check if you can find one that the player dosn't have, like this;
LUA:
for i = 1, 5 do
    if not player:hasMount(i) then
        player:addMount(i)
        return true
    end
end
 
Back
Top