Color fromRGB is not being passed through remote event

Hello, i’m making a gui that will allow the player to select its own tycoon’s color and stuff, but i’m not too certain on where the error is, theres no errors popping up in the output…

Local script

Yellow.Activated:Connect(function()
	local color = '255, 255, 0'
	Subit.Activated:Connect(function()
		event:FireServer(player,color)
		Tween1:Play()
		wait(3)
		MainFrame.Parent.Enabled = false
	end)
end)

Server Script

local RS = game:GetService('ReplicatedStorage')
		local fold = RS:WaitForChild('Remotes')
		local ColrEvent = fold:WaitForChild('SelectColor')
		
		ColrEvent.OnServerEvent:Connect(function(player, color)
			for _, ploz in Plots:GetChildren()do
				if ploz:GetAttribute('Owner') ~= player.UserId then continue end
				ploz.MainParts.Neon.Color = Color3.new(color)
			end
		end)

There’s more to both codes, but these are the main bits that i need help with.
This is a image of the GUI, in case you need it

Don’t pass the player as a parameter from the client. It’s passed automatically.

1 Like

Why not just pass the color as an actual color3? It should look like this:

Local:

Yellow.Activated:Connect(function()
	local color = Color3.new(1,1,0)
	Subit.Activated:Connect(function()
		event:FireServer(color)
		Tween1:Play()
		wait(3)
		MainFrame.Parent.Enabled = false
	end)
end)

Server:

local RS = game:GetService('ReplicatedStorage')
		local fold = RS:WaitForChild('Remotes')
		local ColrEvent = fold:WaitForChild('SelectColor')
		
		ColrEvent.OnServerEvent:Connect(function(player, color)
			for _, ploz in Plots:GetChildren()do
				if ploz:GetAttribute('Owner') ~= player.UserId then continue end
				ploz.MainParts.Neon.Color = color
			end
		end)
1 Like

Thank you for the quick and easy fix. i didn’t initially knew where i messed up, i tried to use Color3.fromRGB before

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.