Setting Color with Command

for my flood server i have
This script

function GM:PlayerSay( player, text, teamonly )
string.lower(string.Left(text,7)) == "!color " then
player:ChatPrint("Youre color Have been changed")
return ""

how can i make it If i typ like colour !color 255 0 255 that is makes x1 255 x2 0 and x3 255?
Please help me thanks

I think what you’re looking for is string.Explode

It’ll split a string into a table, wherever the first argument appears

eg, in this situation, you could use
local col = string.Explode(" ", text)
And if the player wrote “!color 255 100 0” you’ll get a table with col[1] = “!color”, col[2] is 255, col[3] is 100, and col[4] is 0