My script attempts to change properties in a player's Character whenever they join. I've tried multiple methods to define their character, and have been left with only one that works, but it doesn't technically work the way I want it to.
game.Players.PlayerAdded:Connect(function(client) wait(5) local char = client.Character end)
This does work, but it makes it wait 5 seconds. I'm aware that this will not ALWAYS work, due to the very large range of time it could take up for a player to load their Character in. Please help me with this if you can.
I’m surprised you didn’t come across player.CharacterAdded
. It’s an event that fires when the character is added, and returns it.
e.g.
PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) print(char) print("bruh moment") end) end)