Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Setting everyone to OccludeAll?

I'm trying to set everyone to OccludeAll everytime they respawn. It's not working. Any help appreciated

game.Players.PlayerAdded:connect(function(player) game.Players.player:GetCharacterFromPlayer("Humanoid").NameOcclusion = Enum.NameOcclusion.OccludeAll end)

2 answers

Your problem is on Line 2. You attempt to access game.Players.player, which searches the Players for someone named "player" rather than using the parameter and checking that.

You don't need to search for the player, as it is already set in the parameter. Change line 2 to this:

player.Character.Humanoid.NameOcclusion = Enum.NameOcclusion.OccludeAll
end)

2 comments

0

I would also make a check to see if the character exists as the character could be nil when the player is added.

0

Yes, I would do that as well, I was just giving an example.

Make a loop

Also you never executed that function, it is just sitting there

This discussion is preserved as it was. New answers, comments, and votes are closed.