Weird thing with color3s

So I have a script thats supposed mimic the color of a part onto a particle emmiter

local main = workspace:FindFirstChild("Ring"):FindFirstChild("Main1")

main:GetPropertyChangedSignal("Color"):Connect(function()
	script.Parent.Color = main.Color
end)

but it just doesn’t work

help pls
(the script is in replicatedstorage)

Scripts don’t run in replicatedstorage, unless it’s a modulescript and required by a server/local script from elsewhere. If it’s a serverscript, put it into SSS

1 Like

It’s actually in a particleemitter in replicated storage but the script gets copied to workspace when it’s needed because it is copied into the player’s torso

Is it being cloned into the players character from the server side?

yes it is (ignore character limit)

Part uses a data type Color3 for the color while Particle Emitter uses data type ColorSequence.

yes we realised but when we used colorsequence.new to change color3 to sequence we got errors that it needed color3 but got sequence

Could you show us the full code since the one in your topic is outdated?

local main = workspace:FindFirstChild("Ring"):FindFirstChild("Main1")

main:GetPropertyChangedSignal("Color"):Connect(function()
	script.Parent.Color = ColorSequence.new(main.Color)
end)

Is main a part or a particle emitter?

is script.Parent the particle emitter?

script.Parent.Color = ColorSequence.new{
    ColorSequenceKeypoint.new(0, main.Color),
    ColorSequenceKeypoint.new(1, main.Color)
}

Could you try this by any chance?

ok i will try it and tell u if it works

ColorSequence has a constructor for a Color3 value, there shouldn’t be a need to do that

1 Like

it still isn’t working.
script:

local main = workspace:FindFirstChild("Ring"):FindFirstChild("Main1")

main:GetPropertyChangedSignal("Color"):Connect(function()
	script.Parent.Color = ColorSequence.new{
		ColorSequenceKeypoint.new(0, main.Color),
		ColorSequenceKeypoint.new(1, main.Color)
	}
end)

Try printing inside the event, check if it even runs.

Are you sure main’s color is being edited on the server and not just the client?

tried it. the command isn’t running.

Just tried it. Seems to be working fine. Your issue is probably that you are changing the Color of Main1 on the client, and it not on the server.

we tried it again the script is now in sss and it still doesnt work. this model is in workspace

local main = workspace:FindFirstChild("Ring"):FindFirstChild("Main1")
local particle = game.ReplicatedStorage:FindFirstChild("Rainbow")

while wait(0.001) do
	main:GetPropertyChangedSignal("Color"):Connect(function()
		particle = ColorSequence.new{
			ColorSequenceKeypoint.new(0, main.Color),
			ColorSequenceKeypoint.new(1, main.Color)
		}
	end)
end

image

That’s a huge memory leak, you are connecting an event every 0.001 seconds. Your original idea was working fine. You just had to make sure you are changing Main 1’s color on the server