I am attempting to replicate a particle into the player torso, and into a model, named the same as the player in the replicated storage through a shop button. Replicating into the player works fine, but :WaitForChild(plr.Name) is not, with nothing happening after that point.
local plr = game.Players.LocalPlayer
local PartOwned = plr.Part1Owned
local RS = game:GetService('ReplicatedStorage')
local Particle = game.ReplicatedStorage:WaitForChild("PurpleSparkles") -- particle
if PartOwned == true then
script.Parent.Visible = false
script.Parent.Parent.Equip.Visible = true
end
script.Parent.MouseButton1Click:Connect(function(player)
local stats = plr:WaitForChild("leaderstats")
local torso = plr.Character:WaitForChild("UpperTorso")
if stats.Gems.Value >= 25 then
stats.Gems.Value = stats.Gems.Value - 25
local SparkleClone2 = Particle:Clone()
SparkleClone2.Parent = plr.Character:WaitForChild("UpperTorso") -- replicating
local SparkleClone = Particle:Clone()
SparkleClone.Parent = game.ReplicatedStorage:WaitForChild("plr.Name") -- where the script fails, in detecting the model named the same as them
script.Parent.Visible = false
script.Parent.Parent.Unequip.Visible = true
PartOwned.Value = true
end
end)
I can't find why the script is not detecting the model. I have checked, and it does match the same name as the player when they join.

1 comment
lol