ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. setElementAlpha

Function

setElementAlpha

Server and clientElementsIdentical to MTA:SA

Sets an element's alpha (0 invisible, 255 opaque). Works on players, peds, objects and vehicles (a vehicle together with its wheels).

Syntax

bool setElementAlpha(element theElement, int alpha)

Arguments

theElementelement
The element.
alphaint
Alpha 0-255.

Returns

true on success.

Example

addEventHandler("onPlayerSpawn", root, function()
    setElementAlpha(source, 120)
    setTimer(setElementAlpha, 5000, 1, source, 255)
end)

See also