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):
https://gyazo.com/3bd01dd602a1e4b92cecf6934b23716f
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:Destroy()
hair1.Color = c
game.ReplicatedStorage.Hair.Hair1.Handle.Color = x
end
if hair2 and (hair2.Parent == dummy or hair2.Parent == char) then
hair2.Color:Destroy()
hair2.Color = c
game.ReplicatedStorage.Hair.Hair2.Handle.Color = x
end
if hair3 and (hair3.Parent == dummy or hair3.Parent == char) then
hair3.Color:Destroy()
hair3.Color = c
game.ReplicatedStorage.Hair.Hair3.Handle.Color = x
end
end
end)
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()
script.Parent.Parent.CustomizeGUI.ColourWheelGui.ColourWheel.MouseButton1Down:Connect(function()
Remote:FireServer("ChangeColor", mouse.Target,ColourWheelGui.ColourDisplay.BackgroundColor3)
end)
Also, here is a SS of my Explorer: