hide players
makes other players and their ui elements invisible.
overview
the hide players feature makes all other players completely invisible, including:
- character models (all body parts and accessories)
- nametags (billboardguis attached to characters)
- healthbars (surfaceguis attached to characters)
- any other ui elements parented to characters
your own character remains visible to you.
how it works
on enable
-
finds all players in
game.Players -
skips local player (you)
-
for each other player's character:
- sets
LocalTransparencyModifier = 1on all baseparts - sets
LocalTransparencyModifier = 1on all decals - sets
Enabled = falseon all billboardguis - sets
Enabled = falseon all surfaceguis
- sets
-
sets up event listeners:
PlayerAdded- handles new players joiningCharacterAdded- handles respawns
localtransparencymodifier
this property makes parts invisible only to you:
- other players still see the character normally
- doesn't affect gameplay or hitboxes
- purely visual on your client
why both transparency and ui hiding?
LocalTransparencyModifierhides the body- disabling billboardguis hides nametags
- disabling surfaceguis hides healthbars
this ensures complete invisibility.
respawn handling
when a player respawns:
CharacterAddedevent fires- small delay (0.1s) to ensure character fully loaded
- visibility function runs on new character
technical implementation
local function setCharacterVisibility(character, visible)
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") or part:IsA("Decal") then
part.LocalTransparencyModifier = visible and 0 or 1
elseif part:IsA("BillboardGui") or part:IsA("SurfaceGui") then
part.Enabled = visible
end
end
end
this function:
- iterates through all descendants
- checks type of each object
- applies appropriate hiding method
use cases
clean screenshots
remove other players to focus on environment or your character.
tutorial videos
eliminate distractions when recording guides.
cinematic shots
create scenes that look single-player.
roleplay recording
film scenes with specific characters only.
limitations
local player not hidden
your own character stays visible. to hide yourself:
- use camera angles that exclude your character
- or modify the source to include local player
doesn't affect npcs
non-player characters (npcs) are not affected. they're not in game.Players.
network ownership
other players' characters are still there on the server. this only affects your visual client.
on disable
when disabled:
-
restores all players:
- sets
LocalTransparencyModifier = 0 - re-enables billboardguis and surfaceguis
- sets
-
disconnects event listeners:
- all
PlayerAddedconnections - all
CharacterAddedconnections
- all
-
clears connection table:
- prevents memory leaks
edge cases handled
mid-session joining
if a player joins while lcs is active, they're automatically hidden.
rapid respawns
the 0.1s delay prevents race conditions with character loading.
leaving players
connections are cleaned up when players leave.
source code
location: features/hidePlayers.lua
key components:
setCharacterVisibility(character, visible)- main hiding logichideAllPlayers()- applies to all current playersshowAllPlayers()- restores all players- event connections stored in
playerConnectionstable
modifying behavior
to hide your own character
change:
if player ~= localPlayer and player.Character then
to:
if player.Character then
to only hide specific players
add a whitelist:
local whitelist = {"PlayerName1", "PlayerName2"}
if not table.find(whitelist, player.Name) and player ~= localPlayer then
-- hide player
end
to hide npcs
npcs aren't in game.Players, so you'd need to:
- find all character models in workspace
- check if they have a humanoid
- apply the same hiding logic