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

Lua Addon doll egg

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,180
Solutions
2
Reaction score
117
tfs 1.2
Hello, I have this script:
creaturescripts

Lua:
local mounts = {
      [1] = {name = "Sparkion", ID = 94},

   
    }
      
function onModalWindow(player, modalWindowId, buttonId, choiceId)
    player:unregisterEvent("VibrantEgg")
    if modalWindowId == 1001 then
        if buttonId == 100 then
                        if player:getItemCount(26194) == 0 then
                                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must have a Vibrant Egg in your backpack!")
                        return false
                        end
            if choiceId == 0 then
                return false
            end
            player:removeItem(26194, 1)
            player:addMount(mounts[choiceId].ID)
            player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
        end
    end
end

When the player chooses a mount that already has and clicks on confirm, gives this error on screen:
dd32b0c6e4e0457289f6188b6d058159.png


How to remove this error? thanks
 
function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
local player = Player(cid)
if not player:hasMount(94) then
player:addMount(94)
player:getPosition():sendMagicEffect(15)
item:remove(1)
doCreatureSay(cid, "You receive the permission to ride a sparkion.", TALKTYPE_ORANGE_1)
else
player:getPosition():sendMagicEffect(3)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have this mount.")
end
return true
end
 
Back
Top