Skip to content

unit_skinnable

The unit_skinnable function checks if a specified unit is skinnable. This function is useful for determining whether a unit can be skinned for resources.

Parameters

  • unit (string): The unit identifier (such as "target", "focus", etc.) to check.

Returns

  • is_skinnable (boolean): Returns true if the unit is skinnable, otherwise returns false.

Example Usage in Lua

Here is an example of how to use the unit_skinnable function in Lua:

local api = ...

-- Function to check if a unit is skinnable and print the result
function PrintUnitSkinnable(unit)
    local is_skinnable = api.unit_skinnable(unit)
    if is_skinnable then
        print("The unit '" .. unit .. "' is skinnable.")
    else
        print("The unit '" .. unit .. "' is not skinnable.")
    end
end

-- Example usage: Check if the target unit is skinnable
PrintUnitSkinnable("target")