Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Setting everyone to OccludeAll?

Asked by 10 years ago

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

Log in to vote
2
Answered by 10 years ago

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)
0
I would also make a check to see if the character exists as the character could be nil when the player is added. Spongocardo 1991 — 10y
0
Yes, I would do that as well, I was just giving an example. SlickPwner 534 — 10y
Ad
Log in to vote
-3
Answered by 10 years ago

Make a loop

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

Answer this question