Hey I have a weird error in my code.
I'm developing a game with a player particle effect, so I want to equip the player with its particle effect when he rejoins the game. (if he had one saved)
For example if I connect and I have the particle #6 saved, the line 71 should activate but nothing happens.
PS: sorry for my bad english i'm french haha
game.Players.PlayerAdded:connect(function(player) wait(10) print("Check if ".. player.Name .." as Particule saved") local ld = player.leaderstats print("Yeah Particle ID ".. ld.Particle.Value .." found. Try to auto-equipe this to player.") if ld.Particle.Value == "1" then local char = workspace:WaitForChild(player.Name) local ID = ld.Particle.Value if char.LowerTorso:FindFirstChild("Particle") then char.LowerTorso["Particle"]:Destroy() local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso else local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso end elseif ld.Particle.Value == "2" then local char = workspace:WaitForChild(player.Name) local ID = ld.Particle.Value if char.LowerTorso:FindFirstChild("Particle") then char.LowerTorso["Particle"]:Destroy() local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso else local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso end elseif ld.Particle.Value == "3" then local char = workspace:WaitForChild(player.Name) local ID = ld.Particle.Value if char.LowerTorso:FindFirstChild("Particle") then char.LowerTorso["Particle"]:Destroy() local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso else local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso end elseif ld.Particle.Value == "4" then local char = workspace:WaitForChild(player.Name) local ID = ld.Particle.Value if char.LowerTorso:FindFirstChild("Particle") then char.LowerTorso["Particle"]:Destroy() local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso else local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso end elseif ld.Particle.Value == "5" then local char = workspace:WaitForChild(player.Name) local ID = ld.Particle.Value if char.LowerTorso:FindFirstChild("Particle") then char.LowerTorso["Particle"]:Destroy() local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso else local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso end elseif ld.Particle.Value == "6" then local char = workspace:WaitForChild(player.Name) local ID = ld.Particle.Value if char.LowerTorso:FindFirstChild("Particle") then char.LowerTorso["Particle"]:Destroy() local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso else local particle = game.ReplicatedStorage.Shop.Particles[ID].Particle:Clone() particle.Parent = char.LowerTorso end end end)
I think Roblox detects that the two values ??are equal but that it does not execute the code afterwards and I do not understand why.
Problem solved i juste replace the string value "1"
by a number value 1