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

Why doesn't the face get removed?

Asked by 10 years ago
game.Players.PlayerAdded:connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)
wait(.1)
newPlayer.Character.Head["face"]:remove() ---- this line
newPlayer.Character.Head.Transparency = 0.99
newPlayer.Character.Torso.Transparency = 1
newPlayer.Character["Left Leg"].Transparency = 1 
newPlayer.Character["Right Leg"].Transparency = 1 
newPlayer.Character["Left Arm"].Transparency = 1  
newPlayer.Character["Right Arm"].Transparency = 1   
end
function onPlayerEntered(newPlayer)
    newPlayer.Changed:connect(function (property) -- to see
        if (property == "Character") then
            onPlayerRespawned(newPlayer)
        end
    end)
end

game.Players.PlayerAdded:connect(onPlayerEntered)

everything is fine except removing the face. did i do something wrong?

0
I believe your problem is a simple fix. Lua is case-sensitive. You did not capitalize the "f" in "Face". SlickPwner 534 — 10y
0
It is lower case. It is spelled right. Tempestatem 884 — 10y

1 answer

Log in to vote
2
Answered by 10 years ago

Hello. I have experienced this same problem also. I tried many different things, but what I believe worked was a small wait of 5 seconds before removing the face.

Another reason it may not work is because :remove() has been deprecated (which means it no longer works). Try :destroy() instead.

0
You could always do :WaitForChild() instead of waiting 5 Tempestatem 884 — 10y
0
WaitForChild() Won't work... I tried that. Well, at least didn't work for me. TheStudentPilot 75 — 10y
0
@DrDominicOConnor, Depreciated doesn't mean it doesn't work. l0cky2013 135 — 10y
Ad

Answer this question