Hi, for some reason, this script below I made doesn’t add the particles in player when they join, but after they die/reset it does.
Does it have to wait for the data to load in or something? I’ve tried a lot and nothing worked for me yet.
If you could help I would appreciate it really a lot!
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(character)
local data = Player:WaitForChild("Data").Wearing
if data.Value ~= "" then
local Wearing = Player.Data.Wearing
local Effect = game.ReplicatedStorage.BuyableParticles:FindFirstChild(Wearing.Value)
local children = Effect:GetChildren()
for i = 1, #children do
if children[i]:IsA("ParticleEmitter") then
local clone = children[i]:Clone()
clone.Parent = character:FindFirstChild("HumanoidRootPart")
clone.LockedToPart = true
end
end
end
end)
end)