Thank you so much for this
Funnily enough just a few hours ago as I was working on a dialogue system, and I was wondering why this wasn’t a thing on roblox yet… I guess my prayers were answered
now I don’t have to spend unnecessary minutes doing it myself!
very convenient indeed.
epic plugin! one question; why use hex colors instead of RGB? Color3.fromRGB(255, 255, 255)
you can split it like this:
local recieved_string = "255, 255, 255"
local split = string.split(recieved_string, ",")
if #split < 3 or #split > 3 then
return
end
print(split) -- {"255", " 255", " 255"}
for _, element in split do
local new_element = string.gsub(element, " ", "") -- removes the extra spaces
local element_index = table.find(split, element)
table.remove(split, element_index)
table.insert(split, element_index, new_element)
end
print(split) -- {"255", "255", "255"}
print(Color3.fromRGB(table.unpack(split))) -- 1, 1, 1 (aka 255, 255, 255)