isElementVisibleTo | Multi Theft Auto: Wiki Skip to content

isElementVisibleTo

Client-side
Server-side
Shared

Pair: setElementVisibleTo

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This checks if an element is visible to a player. This does not check if the player can literally see the element, just that they are aware that it exists. Some so-called per-player elements are able to be visible only to some players, as such this checks if this is the case for a particular element/player combination.

Syntax

isElementVisibleTo ( )

Code Examples

server

This checks if the player is visible to them selves.

addEventHandler("onPlayerSpawn",root,function()
if not isElementVisibleTo(source,source) then --if the player is not visible to them selves
setElementVisibleTo(source,source,true) --then make them visible to them selves.
end
end)

See Also

Element Functions