Hey there so I keep getting this error
09:36:35.008 - ServerScriptService.PlayerStats:28: invalid argument #2 to 'random' (interval is empty)
And I don’t know how to fix it. my FULL script is
---Lighting Settings----
local Lighting = game:GetService("Lighting")
Lighting.ClockTime = 22
Lighting.FogColor = Color3.fromRGB(0,0,0)
Lighting.FogEnd = 200
Lighting.Brightness = 1
local ColorsTable = {}
Color3.fromRGB(255, 0, 0) ---Red
Color3.fromRGB(255, 85, 0)--Orange
Color3.fromRGB(255, 255, 255) ---White
Color3.fromRGB(209, 255, 0)---Yellow
Color3.fromRGB(0, 0, 127)---Blue
Color3.fromRGB(0, 0, 0)---Black
Color3.fromRGB(255, 20, 232)---Pink
Color3.fromRGB(98, 0, 88)---Purple
Color3.fromRGB(3, 74, 3)---Green
Color3.fromRGB(85, 255, 0) ---Lime
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local Parts = char:GetChildren()
local RandomColor = ColorsTable [math.random(1,#ColorsTable)]
for i = 1, #Parts do
if Parts[i].ClassName == "MeshPart" or Parts[i].ClassName == "Part" then
Parts[i].Color = RandomColor
end
end
-----------------------------
local NameTagClone = script.NameTag:Clone()
NameTagClone.Parent = char:FindFirstChild("Head")
NameTagClone.Label.Text = plr.Name
end)
end)
error line is
local RandomColor = ColorsTable [math.random(1,#ColorsTable)]
Please help!