exactly, this happens when you use a local script and you want to detect things without waiting the game to load properly. also, you should use “WaitForChild()” only one time for each instance. with server scripts this doesnt apply. unless the instance you are searching is in replicated storage
yeah this is correct, but what if the character hes searching is a rig and not a player? thats why i wont modify scripts unless the owner explains what he wants to achieve
The thing is that this script is not a local one and it is in ServerScriptService. I want to make it so all players in my game have sparkles and you can’t do that with a local script, at least I don’t think so…
btw, you asked for all the players, so here’s another script:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
sparkles:Clone().Parent = character:WaitForChild("Head")
end
end
this script detect every player who joins the game and everytime their character is added, if so, it clones the sparkles particle and modify his parent to the player’s head