Unable to cast Color3 to token?

Im making a Grass Color Setting where the player will use arrow buttons to go back and forth on a table changing color of the grass

Code:(All help and advice appreciated)

--<Tables & Dictionaries>--
local GrassColors = {
	Color3.fromRGB(75, 100, 41),
	Color3.fromRGB(50, 66, 29),
	Color3.fromRGB(50, 96, 37),
	Color3.fromRGB(89, 95, 47)
}

--<Scripts>--

--Grass Colors
local nextBtn = GrassColor.next
local backBtn = GrassColor.back
local TextLabel = GrassColor.TextLabel

local currcolor = 1
local max = #GrassColors
local min = 1
local Terrain = workspace.Terrain

nextBtn.MouseButton1Click:Connect(function()
	if currcolor < max and currcolor >= min then
		currcolor += 1
		Terrain:SetMaterialColor(GrassColors[currcolor])
		TextLabel.Text = "Color "..tostring(currcolor)
	end
end)

backBtn.MouseButton1Click:Connect(function()
	if currcolor < min and currcolor <= max then
		currcolor -= 1
		Terrain:SetMaterialColor(GrassColors[currcolor])
		TextLabel.Text = "Color "..tostring(currcolor)
	end
end)

The first parameter of SetMaterialColor is the material type, so you will need to add one.

(Enum.Material.Grass, GrassColors[currcolor])

1 Like

I forgot about that it should work now thankyou