I'm trying to give players different colored particles when they reach a certain amount of Money. i have the following Script working perfectly with no errors in studio, however it does nothing in server.
The hierarchy is as follows game.StarterPlayer.StarterCharcterScripts.Part.Script, ParticleEmitter
FE is OFF, and No error present themselves.
I am extremely new with no prior knowledge to scripting, learning from vids and editing for days until something works, an explanation of how i've gone wrong or a point to an alternative method would be most appreciated.
thanks in advance.
local player = game.Players.LocalPlayer
local money = player.leaderstats.Money
while true do
wait()
if money.Value < 1000 then
script.Parent.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
script.Parent.ParticleEmitter.Color = ColorSequence.new(Color3.new(1,1,1))
elseif money.Value > 999 and money.Value < 2500 then
script.Parent.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
script.Parent.ParticleEmitter.Color = ColorSequence.new(Color3.new(0,0,1))
elseif money.Value > 2499 and money.Value < 5000 then
script.Parent.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
script.Parent.ParticleEmitter.Color = ColorSequence.new(Color3.new(1,0,1))
elseif money.Value > 4999 and money.Value < 10000 then
script.Parent.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
script.Parent.ParticleEmitter.Color = ColorSequence.new(Color3.new(0,1,0))
elseif money.Value > 9999 and money.Value < 25000 then
script.Parent.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
script.Parent.ParticleEmitter.Color = ColorSequence.new(Color3.new(0,1,1))
elseif money.Value > 24999 and money.Value < 75000 then
script.Parent.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
script.Parent.ParticleEmitter.Color = ColorSequence.new(Color3.new(1,0,0))
elseif money.Value > 74999 and money.Value < 500000 then
script.Parent.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
script.Parent.ParticleEmitter.Color = ColorSequence.new(Color3.new(0,0,0))
elseif money.Value > 499999 and money.Value < 1000000 then
script.Parent.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
script.Parent.ParticleEmitter.Color = ColorSequence.new(Color3.new(1,1,0))
end
end
end)

3 comments
Why are u using a while trough loop inside a while trough loop, if you use changed every time it changes a bit it runs that script..
trough = true*
like i said i have no knowledge haha, i went ahead and removed the .Changed event though and it is still functioning the same. Works in Studio, Not in Server.