~~~~~~~~~~~ target = game.Players
function onPlayerRespawned() target.Head.face.Texture = "" end
script.Parent.MouseButton1Click:connect(onPlayerRespawned)
~~~~~~
~~~~~~~~~~~~~~~~~ i'm trying to make when u enter the game or respawn it removes player's face
Okay, you have a few problems here.
First of all, you are targeting the Players category, not all of the players. To select the player, you would either have to use the player
parameter of function
s, or use LocalPlayer in a LocalScript. In this case, I will be using the player parameter.
Second of all, you want the player's face to change when they respawn, but your connection line makes it run the function when they click a button.
Try out this code, I will explain it in comments:
target = game.Players:GetChildren() --Sets the target to everyone in the Players area of the game. function onPlayerRespawned(player) wait(6) --Waits 6 seconds after they die repeat wait() until player.Character and player.Character.Head.Face --Waits until the player's character and the player's face loads. player.Character.Head.Face:Destroy() --Destroys the face. end player.Died:connect(onPlayerRespawned) --As far as I know, there is no way to check when a player respawns in a connection line, so I had it run when they died, then wait 6 seconds so that their character reloads. game.Players.PlayerAdded:connect(onPlayerRespawned) --Runs the function when a player joins