✓ Accepted answer
Well, you see, the 'PlayerAdded' (or 'ChildAdded' in your case) event is straight away fired when a player joins the game, meaning the script doesn't wait for the children inside.
What I do recommend is waiting for the Backpack, which can be done so by using the following code:
repeat wait() until newPlayer:FindFirstChild('Backpack')
Note, the above code can be written in different ways (eg. using 'WaitForChild' or, a less cleaner way, while not newPlayer.Backpack do)
You can add this wait either before or after your line 4, so it would ultimately look like this:
adminName = "potato12344"
function onEntered(newPlayer)
repeat wait() until newPlayer.Backpack
if newPlayer.Name == adminName then
local nitro = game.ReplicatedStorage.Nitro
local newnitro = nitro:Clone()
newnitro.Parent = newPlayer.Backpack
end
end
game.Players.ChildAdded:connect(onEntered)
And there you are.
If you still have a problem, just let me know.
Good luck.
Please upvote if I helped
PS. I do recommend cloning to StarterGear aswell so that the player has it even after dying
5 comments
Any errors?
Not that i know of. Its just not cloning
Maybe just try using the PlayerAdded event on line 11 instead. Not sure if it'll matter, but that's all that strikes my eye. game.Players.PlayerAdded:connect(onEntered)
Okay thanks.
Hm, It doesn't change a thing sadly :/ I don't know what else to try, I've tried changing the function and everything but it still doesn't work. Thanks for the help anyway