Skip to main content

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

  1. finds all players in game.Players

  2. skips local player (you)

  3. for each other player's character:

    • sets LocalTransparencyModifier = 1 on all baseparts
    • sets LocalTransparencyModifier = 1 on all decals
    • sets Enabled = false on all billboardguis
    • sets Enabled = false on all surfaceguis
  4. sets up event listeners:

    • PlayerAdded - handles new players joining
    • CharacterAdded - 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?

  • LocalTransparencyModifier hides the body
  • disabling billboardguis hides nametags
  • disabling surfaceguis hides healthbars

this ensures complete invisibility.

respawn handling

when a player respawns:

  1. CharacterAdded event fires
  2. small delay (0.1s) to ensure character fully loaded
  3. 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:

  1. restores all players:

    • sets LocalTransparencyModifier = 0
    • re-enables billboardguis and surfaceguis
  2. disconnects event listeners:

    • all PlayerAdded connections
    • all CharacterAdded connections
  3. 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 logic
  • hideAllPlayers() - applies to all current players
  • showAllPlayers() - restores all players
  • event connections stored in playerConnections table

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:

  1. find all character models in workspace
  2. check if they have a humanoid
  3. apply the same hiding logic