• 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.4.2 CLICK ON STATUE OR CHEST GIVE OUTFIT/MOUNT

Solution
not tested but try

Lua:
local outfitConfig = {
    [1000] = {outfitMale = 10, outfitFemale = 12, storage = 10000},
    [1001] = {outfitMale = 11, outfitFemale = 13, storage = 10001},
}
local action = Action()
function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    local outfitScript = outfitConfig[item:getActionId()]
    if not outfitScript then
        return true
    end
    if player:getStorageValue(outfitScript.storage) == 1 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue.')
        return true
    end
    player:addOutfit(outfitScript.outfitMale)
    player:addOutfit(outfitScript.outfitFemale)
    player:addOutfitAddon(outfitScript.outfitMale addon)...
not tested but try

Lua:
local outfitConfig = {
    [1000] = {outfitMale = 10, outfitFemale = 12, storage = 10000},
    [1001] = {outfitMale = 11, outfitFemale = 13, storage = 10001},
}
local action = Action()
function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    local outfitScript = outfitConfig[item:getActionId()]
    if not outfitScript then
        return true
    end
    if player:getStorageValue(outfitScript.storage) == 1 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue.')
        return true
    end
    player:addOutfit(outfitScript.outfitMale)
    player:addOutfit(outfitScript.outfitFemale)
    player:addOutfitAddon(outfitScript.outfitMale addon)
    player:addOutfitAddon(outfitScript.outfitFemale, addon)
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received a new outfit.')
    player:setStorageValue(outfitScript.storage, 1)
    return true
end
for k, v in pairs(outfitConfig) do
    action:aid(k)
end
action:register()
------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------
local mountConfig = {
    [2000] = {mountId = 10, storage = 20000},
    [2001] = {mountId = 10, storage = 20001},
}
local action = Action()
function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    local mountScript = mountConfig[item:getActionId()]
    if not mountScript then
        return true
    end
    if player:getStorageValue(mountScript.storage) == 1 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue.')
        return true
    end
    player:addMount(mountScript.mountId)
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received a new mount.')
    player:setStorageValue(mountScript.storage, 1)
    return true
end
for k, v in pairs(mountConfig) do
    action:aid(k)
end
action:register()

1000 is actionid, change it to your actionId you want and OutfitId and MountId says everything :D
 
Last edited:
Solution
not tested but try

Lua:
local outfitConfig = [
    [1000] = {outfitMale = 10, outfitFemale = 12, storage = 10000},
    [1001] = {outfitMale = 11, outfitFemale = 13, storage 10001},
]

local action = Action()

function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    local outfitScript = outfitConfig[item:getActionId()]
    if not outfitScript then
        return true
    end
    if player:getStorageValue(outfitScript.storage) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue'.)
        return true
    end
    player:addOutfit(outfitScript.outfitMale, 3)
    player:addOutfit(outfitScript.outfitFemale, 3)
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received a new outfit')
    player:setStorageValue(outfitScript.storage, 1)
    return true
end

for k, v in pairs(config) do
    action:aid(k)
end

action:register()
------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------
local mountConfig = [
    [2000] = {mountId = 10, storage = 20000},
    [2001] = {mountId = 10, storage = 20001},
]

local action = Action()

function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    local mountScript = mountConfig[item:getActionId()]
    if not mountScript then
        return true
    end
    if player:getStorageValue(mountScript.storage) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue'.)
        return true
    end
    player:addMount(mountScript.mountId)
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received a new mount')
    player:setStorageValue(mountScript.storage, 1)
    return true
end

for k, v in pairs(config) do
    action:aid(k)
end

action:register()

1000 is actionid, change it to your actionId you want and OutfitId and MountId says everything :D
ty i'll try but where i will put this file can you explain
 
ty i'll try but where i will put this file can you explain

updated my script btw it has some bugs
storage must be always a different
storage has been used to check if player has used the statue alredy
outfitMale = male outfit ID
outfitFemale = female outfit ID
mountId = Mount ID

1698349755935.png

this is actionId
 
updated my script btw it has some bugs
storage must be always a different
storage has been used to check if player has used the statue alredy
outfitMale = male outfit ID
outfitFemale = female outfit ID
mountId = Mount ID

View attachment 79500

this is actionId
i did it but its saying 23:08 You alredy used that statue. and i didnt click on it
 
Maybe the outfit is either only for premium or not enabled in outfits.xml

And I'm pretty sure player:addOutfit() only takes one argument (lookType), so you can change:
Lua:
player:addOutfit(outfitScript.outfitMale, 3)
player:addOutfit(outfitScript.outfitFemale, 3)
To:
Lua:
player:addOutfit(outfitScript.outfitMale)
player:addOutfit(outfitScript.outfitFemale)

And if you want to add addons aswell, you can use:
Lua:
player:addOutfitAddon(lookType, addon)
 
Last edited:
Maybe the outfit is either only for premium or not enabled in outfits.xml

And I'm pretty sure player:addOutfit() only takes one argument (lookType), so you can change:
Lua:
player:addOutfit(outfitScript.outfitMale, 3)
player:addOutfit(outfitScript.outfitFemale, 3)
To:
Lua:
player:addOutfit(outfitScript.outfitMale)
player:addOutfit(outfitScript.outfitFemale)

And if you want to add addons aswell, you can use:
Lua:
player:addOutfitAddon(lookType, addon)

oh forgot that outfitAddon function exists
 
Back
Top