Why doesn't this work?

I am trying to make it so that a color wheel will change the color of a hair accessory. I have a local script inside of a gui, and a server script in serverscriptservice, and all the hairs are inside replicated storage. I have no errors in output… Here is a video of what system I am running (The scripts will be provided below the video):

Server Script

local Remote = game:GetService("ReplicatedStorage").HairColorChange
local rs = game:GetService("ReplicatedStorage").Hair
Remote.OnServerEvent:Connect(function(Player, ActionRemote, Color)
	local hair1 = rs:WaitForChild("Hair1" ..  tostring(Color), 1)
	local hair2 = rs:WaitForChild("Hair2" ..  tostring(Color), 1)
	local hair3 = rs:WaitForChild("Hair3" ..  tostring(Color), 1)
	local c = game.StarterGui.CustomizeGUI.ColourWheelGui.ColourDisplay.BackgroundColor3
	local dummy = game.Workspace.customizegui.l
	local char = game.Players.LocalPlayer
	local x = game:GetService("StarterGui").CustomizeGUI.ColourWheelGui.ColourDisplay.BackgroundColor3
	if ActionRemote == "ChangeColor" then
		if hair1 and (hair1.Parent == dummy or hair1.Parent == char) then
			hair1.Color = c
			game.ReplicatedStorage.Hair.Hair1.Handle.Color = x
		if hair2 and (hair2.Parent == dummy or hair2.Parent == char) then
			hair2.Color = c
			game.ReplicatedStorage.Hair.Hair2.Handle.Color = x
		if hair3 and (hair3.Parent == dummy or hair3.Parent == char) then
			hair3.Color = c
			game.ReplicatedStorage.Hair.Hair3.Handle.Color = x

Local Script:

local Remote = game:GetService("ReplicatedStorage").HairColorChange
local player = game.Players.LocalPlayer 
local PGUI = player:WaitForChild("PlayerGui")   
local ColourWheelGui = game:GetService("StarterGui").CustomizeGUI.ColourWheelGui
local RS = game:GetService("ReplicatedStorage")     
local mouse = player:GetMouse()   
	Remote:FireServer("ChangeColor", mouse.Target,ColourWheelGui.ColourDisplay.BackgroundColor3)

Also, here is a SS of my Explorer:



Maybe the most stupid question ever, but I’m still gonna ask it.

Do the hairs have textures set? If so, colors won’t have any effect.

Not a stupid question at all; that was one of the first things i checked tho lol. They do not

1 Like

Any reason why you’re firing the remote event so much? Could you not just do everything on the client then at the end to confirm the color just fire one remote?

I suggest you to use print() through your scripts, just to make sure your code gets through the if statements and also check if nothing is nil.

I’m not sure, at the time of starting this script, firing the event just seemed to make sense to me. I’m gonna try and remake it with your suggestion and I will let you know how it goes