Trying to fire a table to the server but the values aren't changing

The title basically explains my problem.

What I’m trying to achieve:
The client chooses Ice-cream flavor and toppings and sends a table of data(about the chosen ice-cream) to the server.
The problem:
The server is outputting nil when trying to edit the Ice Cream that will be given to the player.
The Code:

local sendData = {
						cherry = false,
						glaze = false,
						sprinkles = false,
						OreoTop = false,
						OreoBottom = false,
						LayerTop = false, -- color for top layer
						LayerBottom = false -- color for bottom layer
--- for the purpose of being concise Im gonna show 
--he values changing and firing the table 
                                      sendData[4] = true
                                      sendData[7] = v.BackgroundColor3
                                      sendData[3] = true
                                      sendData[5] = false
                                      sendData[6] = v.BackgroundColor3
                                      sendData[1] = true
                                      sendData[2] = true
                                      sendData[3] = true


IEvent.OnServerEvent:Connect(function(player, data)
		local cone = player.Backpack:FindFirstChild('Cone')
		cone.Name = 'IceCream'
		local data2 = {
			baseColor = data[7],
			secondaryColor = data[6],
			oreoBottom = data[5],
			oreoTop = data[4],
			sprinkles = data[3],
			glaze = data[2],
			cherry = data[1]
		local l1 = data.layer1Base
		local l2 = data.layer2Base
		cone.Layer1Base.Color = data2.baseColor
		cone.Layer1Main.Color = data2.baseColor
		cone.Layer2Base.Color = data2.secondaryColor
		cone.Layer2Main.Color = data2.secondaryColor
		cone.Layer1Base.Transparency = 0
		cone.Layer1Main.Transparency = 0
		cone.Layer2Base.Transparency = 0
		cone.Layer2Main.Transparency = 0

		if data2.oreoTop== true then
			for i,v in pairs(cone.ChipsT) do
				v.Transparency = 0
		if data2.oreoBottom == true then
			for i,v in pairs(cone.ChipsB) do
				v.Transparency = 0
		if data2.glaze == true then
			cone.Glaze.Transparency = 0.45
		if data2.cherry == true then
			cone.CherryOnTop.Transparency = 0
		if data2.sprinkles == true then
			for i,v in pairs(cone.Sprinkles:GetChildren()) do
				v.Transparency = 0.9
1 Like

You’re setting the values to a bool, meaning they can only be changed as a bool, you need to set the values in the table to nil not false.

Oh hokay let me try that, thanks for respondig

1 Like

Server is still outputting nil, I dont know why

invalid argument #3 (Color3 expected, got nil)

Yeah that’s because the table you’re firing is in a random order, you’re trying to set a Color3 value when you need to convert it, do sendData[7] = Color3.fromRGB(v.BackgroundColor3)

It works no errors, but both ice cones are black

Im setting the background color 3 of the textbutton with the text ‘selected’ to the sendData[7] value
The console is printing (0,0,0) everytime the button is clicked (where I change the color value)