SetEntityLocallyInvisible
DocsSetEntityLocallyInvisible(entity)Description
Sets the provided entity not visible for yourself for the current frame.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | — |
Quick Snippet: Get Entityentity
entityUse this to obtain an entity handle from the player's aim or crosshair.
-- Get the entity the player is aiming at
local ped = PlayerPedId()
local hit, entity = GetEntityPlayerIsFreeAimingAt(PlayerId())
if hit and entity ~= 0 then
print("Entity: " .. entity)
print("Model: " .. GetEntityModel(entity))
print("Type: " .. GetEntityType(entity)) -- 1=Ped, 2=Vehicle, 3=Object
endReturns
voidThis native does not return a value.
Examples
Official
CreateThread(function()
-- Any random entity should work
local entity = PlayerPedId()
-- Make the entity visible for all players
SetEntityVisible(entity, true)
while true do
Wait(0)
-- Make the entity invisible for the current player only.
SetEntityLocallyInvisible(entity)
end
end)