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

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Hello help me with a script that is to tame this mount "Gryphon" but only with this mask on and its items to tame

A) Mask: 36204
B) Item Tamed: 36411
Monster Name: Gryphon
Mount ID: 144


Gryphon.png
Note: You must have the Mask "Item A" on to be able to use the Item Tamed "Item B" on the Monster name "Gryphon"
 
Solution
try this

data/scripts/scriptname.lua
Lua:
local config = {
    maskId = 0000,
    tamedId = 0000,
    monsterName = "Gryphon",
    mountId = 144,
    chance = 100
}

local action = Action()

function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    if not target or not target:isMonster() or target:getName() ~= config.monsterName then
        return true
    end

    if player:hasMount(config.mountId) then
        player:sendCancelMessage("You already have this mount.")
        return true
    end

    local mask = player:getSlotItem(CONST_SLOT_HEAD)
    if not mask or mask:getId() ~= config.maskId then
        player:sendCancelMessage("You must have the mask equipped.")
        return true
    end...
try this

data/scripts/scriptname.lua
Lua:
local config = {
    maskId = 0000,
    tamedId = 0000,
    monsterName = "Gryphon",
    mountId = 144,
    chance = 100
}

local action = Action()

function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    if not target or not target:isMonster() or target:getName() ~= config.monsterName then
        return true
    end

    if player:hasMount(config.mountId) then
        player:sendCancelMessage("You already have this mount.")
        return true
    end

    local mask = player:getSlotItem(CONST_SLOT_HEAD)
    if not mask or mask:getId() ~= config.maskId then
        player:sendCancelMessage("You must have the mask equipped.")
        return true
    end

    item:remove(1)
    mask:remove() -- remove this line if you don't want to remove the mask

    if config.chance >= math.random(1, 100) then
        target:remove()
        toPos:sendMagicEffect(CONST_ME_MAGIC_GREEN)
        player:addMount(config.mountId)
    else
        player:sendCancelMessage("Taming has failed, try again.")
        toPos:sendMagicEffect(CONST_ME_POFF)
    end
    return true
end

action:id(config.tamedId)
action:register()
 
Solution
try this

data/scripts/scriptname.lua
Lua:
local config = {
    maskId = 0000,
    tamedId = 0000,
    monsterName = "Gryphon",
    mountId = 144,
    chance = 100
}

local action = Action()

function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    if not target or not target:isMonster() or target:getName() ~= config.monsterName then
        return true
    end

    if player:hasMount(config.mountId) then
        player:sendCancelMessage("You already have this mount.")
        return true
    end

    local mask = player:getSlotItem(CONST_SLOT_HEAD)
    if not mask or mask:getId() ~= config.maskId then
        player:sendCancelMessage("You must have the mask equipped.")
        return true
    end

    item:remove(1)
    mask:remove() -- remove this line if you don't want to remove the mask

    if config.chance >= math.random(1, 100) then
        target:remove()
        toPos:sendMagicEffect(CONST_ME_MAGIC_GREEN)
        player:addMount(config.mountId)
    else
        player:sendCancelMessage("Taming has failed, try again.")
        toPos:sendMagicEffect(CONST_ME_POFF)
    end
    return true
end

action:id(config.tamedId)
action:register()
perfect
 
Back
Top