Why does this Color3 not work properly? "Color cannot be assigned to"
So I have this script in a LocalScript inside a tool:
02 | if script.Parent.Holding.Value ~ = nil then |
03 | if script.Parent.Holding.Value = = "ZM-3" then |
04 | game.ReplicatedStorage.Events.ChangeHoldColor:FireServer(Color 3. fromRGB( 0 , 255 , 0 ), script.Parent) |
06 | if script.Parent.Holding.Value = = "ST-14" then |
07 | game.ReplicatedStorage.Events.ChangeHoldColor:FireServer(Color 3. fromRGB( 255 , 255 , 0 ), script.Parent) |
09 | if script.Parent.Holding.Value = = "SM-P2" then |
10 | game.ReplicatedStorage.Events.ChangeHoldColor:FireServer(Color 3. fromRGB( 0 , 255 , 255 ), script.Parent) |
12 | if script.Parent.Holding.Value = = "ZD-6" then |
13 | game.ReplicatedStorage.Events.ChangeHoldColor:FireServer(Color 3. fromRGB( 0 , 0 , 255 ), script.Parent) |
15 | if script.Parent.Holding.Value = = "L3-STD" then |
16 | game.ReplicatedStorage.Events.ChangeHoldColor:FireServer(Color 3. fromRGB( 255 , 0 , 0 ), script.Parent) |
18 | if script.Parent.Holding.Value = = "LT-5Z" then |
19 | game.ReplicatedStorage.Events.ChangeHoldColor:FireServer(Color 3. fromRGB( 85 , 85 , 0 ), script.Parent) |
22 | game.ReplicatedStorage.Events.ChangeHoldColor:FireServer(Color 3. fromRGB( 255 , 255 , 255 ), script.Parent) |
I have an event in Events folder in ReplicatedStorage and I have this script in ServerScriptService for it:
1 | game.ReplicatedStorage.Events.ChangeHoldColor.OnServerEvent:Connect( function (color, part) |
The tools work fine but the color doesn't change and I get this error:
18:08:51.099 - Color cannot be assigned to
18:08:51.101 - Stack Begin
18:08:51.103 - Script 'ServerScriptService.HoldColor', Line 2
18:08:51.105 - Stack End
Please help if you know how to fix this error or what causes it.