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

Help w/ PlayerAdded event?

I want this script to make the players head turn 0.5 Transparecy when they join(PlayerAdded)

Player = game.Players.character.Head
game.Players.PlayerAdded:connect(function(Player)
	Player.Transparency = 0.5
end)

2 answers

✓ Accepted answer

There you go

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)	
    character.Head.Transparency = 0.5
end)
end)

You're over defining 'player'

--Let's not define 'Player' because you then redefine it
game.Players.PlayerAdded:connect(function(plr)
    game.Workspace[plr.Name].Head.Transparency = .5
end)

1 comment

1

Although this method works, I find that it can break, and it only runs once when the player joins, and that this will only work on Roblox studio.. It's better to use plr.Character.Head.Transparency, but the other answer is better since PlayerAdded is only when the player joins. The reason why it wont work in Online mode is that the character isn't done loading when even the PlayerAdded event fired

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