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...
If I write to you for discord, will you help me create it? I'm bad at scriptingHi
do you prefer a finished script
or should we help you with creating it
kind regards
i would rather it was readyyou can write it here
no worries we wont atk you if you do something wrong
in that case we can help the community and you at once!
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()
perfecttry 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()