Color changer not working

I am trying to create a GUI that lets players customize their shields in-game and I am having trouble getting it to work, so far I do not see any errors in the output, does anyone know what I am doing wrong?

Client Script
script.Parent.ShieldC.Black.MouseButton1Down:connect(function()
	local Color2 = BrickColor.new("Lapis")
	game.StarterGui.Menu.Sound.Click:Play()
	local c = game.Workspace:FindFirstChild(Player.Name)
	if c:FindFirstChild("ShieldModel") then

	game.ReplicatedStorage.RemoteEvents:WaitForChild("changeColor"):FireServer(Player, Color2, c)

	end
end)


Server Script

game.ReplicatedStorage.RemoteEvents:WaitForChild("changeColor").OnServerEvent:Connect(function(Player, Color2, c)
	

	c.ShieldModel.Main.BrickColor = Color2

	
end)



1 Like

Is there any chance you forgot to enable Allow HTTP Requests in your game settings? Sometimes I’ll forget that when I’m testing RemoteEvents.

If not then try doing print tests or try a different way of setting the BrickColor.

1 Like

I’m pretty sure everything in StarterGui gets cloned into the player’s playergui. Try doing

game.Players.LocalPlayer.PlayerGui.Menu.Sound.Click:Play()
2 Likes

Yes, and make sure to declare the Players first

local PlayerGUI = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local StarterGui = game:GetService("StarterGui")
-- random code filling here
game.Players.LocalPlayer.PlayerGui.Menu.Sound.Click:Play()
3 Likes

When calling fireserver, the Player is always passed, so remove that parameter. On the server, you can leave the Player argument as it is.

2 Likes