Player's Backpack doesn't receive tools from script, what's the problem?
The following code uses a "for" loop to clone game.ServerStorage.Tools.Donut (a tool) and give it to a player who joined the game:
1 | game.Players.PlayerAdded:Connect( function (client) |
4 | until client:FindFirstChild( "Backpack" ) |
5 | local donut = game.ServerStorage.tools.Donut:Clone() |
6 | donut.Parent = client.Backpack |
This didn't work, so I tried putting wait() once the client joins
1 | game.Players.PlayerAdded:Connect( function (client) |
5 | until client:FindFirstChild( "Backpack" ) |
6 | local donut = game.ServerStorage.tools.Donut:Clone() |
7 | donut.Parent = client.Backpack |
This worked, though. I'm not sure why it's like this. Is it because the player's Character needs to be loaded for them to recieve the tools?