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

problem with wings

verdehile95

Member
Joined
Jan 31, 2024
Messages
64
Reaction score
6
I have a question: how can I make it so that when I use the wings item, it will add wings to my outfit?
 

Attachments

Revscript
LUA:
local ITEM_ID = 38676 -- Item ID that the player can click to add mounts
local STORAGE_KEY = 941006 -- Unique storage key for tracking usage

local addMountSystem = Action()

function addMountSystem.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid ~= ITEM_ID then
        return true
    end

    -- Check if the player has already used this item
    if player:getStorageValue(STORAGE_KEY) == 1 then
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have already used this item.")
        return true
    end

    -- Apply mounts without changing the outfit
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
    player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have received 3 free mounts.')

    -- Mark the item as used
    player:setStorageValue(STORAGE_KEY, 1)

    -- Set specific storage values for mounts
    local mountStorages = {90550, 90551, 90552}
    for _, storage in ipairs(mountStorages) do
        player:setStorageValue(storage, 1)
    end
    
    item:remove(1)
    return true
end

addMountSystem:id(ITEM_ID)
addMountSystem:register()
 
Last edited:
Revscript
LUA:
local ITEM_ID = 38676 -- Item ID that the player can click to add mounts
local STORAGE_KEY = 941006 -- Unique storage key for tracking usage

local addMountSystem = Action()

function addMountSystem.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid ~= ITEM_ID then
        return true
    end

    -- Check if the player has already used this item
    if player:getStorageValue(STORAGE_KEY) == 1 then
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have already used this item.")
        return true
    end

    -- Apply mounts without changing the outfit
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
    player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have received 3 free mounts.')

    -- Mark the item as used
    player:setStorageValue(STORAGE_KEY, 1)

    -- Set specific storage values for mounts
    local mountStorages = {90550, 90551, 90552}
    for _, storage in ipairs(mountStorages) do
        player:setStorageValue(storage, 1)
    end
   
    item:remove(1)
    return true
end

addMountSystem:id(ITEM_ID)
addMountSystem:register()
This is Mount system not wing
 
This is Mount system not wing
just change mount To wing xDDD
Post automatically merged:

LUA:
local ITEM_ID = 38676 -- Item ID that the player can click to add wings
local STORAGE_KEY = 941006 -- Unique storage key for tracking usage

local addWingSystem = Action()

function addWingSystem.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid ~= ITEM_ID then
        return true
    end

    -- Check if the player has already used this item
    if player:getStorageValue(STORAGE_KEY) == 1 then
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have already used this item.")
        return true
    end

    -- Apply wings without changing the outfit
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
    player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have received 3 free wings.')

    -- Mark the item as used
    player:setStorageValue(STORAGE_KEY, 1)

    -- Set specific storage values for wings
    local wingStorages = {90550, 90551, 90552}
    for _, storage in ipairs(wingStorages) do
        player:setStorageValue(storage, 1)
    end
    
    item:remove(1)
    return true
end

addWingSystem:id(ITEM_ID)
addWingSystem:register()
 
Ok and let me know if it worked well
I get the notification but it still doesn't work
Post automatically merged:

I added this to the code and now it works
LUA:
function Player.hasWings(self)
    -- Zwraca `true` jeśli gracz ma przypisane skrzydła (sprawdzając wartość w `Storage`)
    return self:getStorageValue(905) == 1 -- Sprawdza, czy gracz ma przypisane skrzydło z ID 905
end
 

Attachments

Last edited:
I get the notification but it still doesn't work
Post automatically merged:

I added this to the code and now it works
LUA:
function Player.hasWings(self)
    -- Zwraca `true` jeśli gracz ma przypisane skrzydła (sprawdzając wartość w `Storage`)
    return self:getStorageValue(905) == 1 -- Sprawdza, czy gracz ma przypisane skrzydło z ID 905
end
you just was needed to add your wing storage 905
 
Back
Top