Hey!
I’m making Particle Emitters appear on your hands for my game but I’ve come across a weird bug.
So for normal avatars everything works fine but for rthro ones for some reason it doesn’t give them the particleEmitters.
Here is my script:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local fistParticles = ReplicatedStorage.fistParticles
--Functions
local function putParticle(particle, leftHand, rightHand)
--Destroy old particles
if particle.Name == "Ice" then
if leftHand:FindFirstChild("Fire") then
leftHand.Fire:Destroy()
rightHand.Fire:Destroy()
end
elseif particle.Name == "Electro" then
if leftHand:FindFirstChild("Ice") then
leftHand.Ice:Destroy()
rightHand.Ice:Destroy()
end
end
local particle1 = particle:Clone()
local particle2 = particle:Clone()
particle1.Parent = leftHand
particle2.Parent = rightHand
print(particle1.Parent.Name) --> LeftHand --> works perfectly but it doesn't appear
end
local function check(strenght, leftHand, rightHand)
if strenght.Value >= 10 and strenght.Value <= 30 then --10 to 30
if not leftHand:FindFirstChild(fistParticles.Fire.Name) then
putParticle(fistParticles.Fire, leftHand, rightHand)
end
elseif strenght.Value >= 30 and strenght.Value <= 50 then --30 to 50
if not leftHand:FindFirstChild(fistParticles.Ice.Name) then
putParticle(fistParticles.Ice, leftHand, rightHand)
end
elseif strenght.Value >= 50 and strenght.Value <= 70 then --50 to 70
if not leftHand:FindFirstChild(fistParticles.Electro.Name) then
putParticle(fistParticles.Electro, leftHand, rightHand)
end
elseif strenght.Value >= 70 and strenght.Value <= 100 then --70 to 100
--Not released yet
print("Not released yet!")
end
end
--Initialization
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local leaderstats = plr:WaitForChild("leaderstats")
local strenght = leaderstats:WaitForChild("Strength")
local rightHand = char:WaitForChild("RightHand")
local leftHand = char:WaitForChild("LeftHand")
check(strenght, leftHand, rightHand) --He just resetted, so set it up
strenght:GetPropertyChangedSignal("Value"):Connect(function()
check(strenght, leftHand, rightHand) --His strength property changed, set it up
end)
end)
end)
See how it doesn’t work for Rthro (dont laugh at my character, its just for testing purposes lol)
See how there is no particleEmitters on his hands.
With my normal character however, it works fine as you can see in the picture below.
I really don’t know what could cause this.
If you need additional information, just tell me.
Thank you!