I’m attempting to make my player’s head be at .8 transparency, but this isn’t working out. It returns 0 errors. I’m sure it’s something very simple, but i don’t know what I’m doing wrong. thanks.
It’s because you’re calling Player:WaitForChild(“Character”)
Character isn’t a descendant of Player, it’s a property.
Instead, do
game.Players.PlayerAdded:connect(function(player)
local Character = player.Character or player.CharacterAdded:wait()
Character.Head.Transparency = .8
end)
Just to complicate things further, here’s code that handles the extremely small possibility that the player leaves during a spawn and the head didn’t load yet, thus avoiding an infinite yield waiting for the head:
game:GetService("Players").PlayerAdded:Connect(function (player)
player.CharacterAdded:Connect(function (character)
local head = character:WaitForChild("Head", 5)
if (head) then
head.Transparency = 0.8
end
end)
end)