Body Colour Script not working!

Good work, have a nice evening and happy scripting!

1 Like

Quick Update:

I tried doing what you said to do because my fix wasn’t working too well and yours is much easier than what I did but now I am having the same problem where it prints 0, 0, 0 and sets their skin to 0, 0, 0

Hi!

And what have you tried so far?

What I did was give the colour through event:FireServer(colour)

You gotta check where the issue starts, you do this by printing the color value in the different places in your script.

Okay, it looks like the problem is the LocalScript because it’s printing 0, 0, 0 from there.

Do you have any idea what could be wrong?

local GUI = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local player = game.Players.LocalPlayer
local char = player.Character
local event = game.ReplicatedStorage.Customize.Events.BodyColour

local button = script.Parent

button.MouseButton1Click:Connect(function()

	local colour = Color3.fromRGB(button.BackgroundColor)

	print(colour)
	
	event:FireServer(colour)

end)

EDIT: Changing line 10 to local colour = button.BackgroundColor3 makes it change properly but it prints a Color3 value, how could I make it print RGB?

Hi,

Where are you changing the color? On the server? How does the client get that info?

The LocalScript (a child of a button) grabs the colour of the button, gives it to the server, and fires the colour changing with that colour.

And the server prints the color correctly?

Everything works properly it just prints the colour as a Color3 value (Example: 0.2334, 0.4321, 0.3874) instead of an RGB value (Example: 234, 124, 187)