Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to convert this string to color3?

how do i go about converting this to color3.fromHSV

local W = Instance.new("StringValue")
W.Name = "Color"
W.Value = "0.00001, 1, 0.215"
wait()
game.Players.LocalPlayer.Character.Head.Face.Color3 = Color3.fromHSV(W.Value)

1 answer

✓ Accepted answer

A solution would be that you use a comma for the Rgb values from color3 Rgb basically means (Red,Green and blue)

So basically your code should look something like this... First insert the rgb values

local rvalue=tonumber(r)
local gvalue=tonumber(g)
local bvalue=tonumber(b)

local rgb=Color3.new(rvalue,bvalue,gvalue)
local text= "73,37,40"

local length1=string.find(text,",")
length1=length1-1

local num1=string.sub(text,1,length1)



local length2=string.find(text,",",length1+2)
length2=length2-1


local num2=string.sub(text,length1+2,length2)



local num3=string.sub(text,length2+2,string.len(text))



local combined= num1..num2..num3

local color=Color3.new(num1,num2,num3)
print(combined)

4 comments

0

is there a way to make that as color3.fromHSV?

1

I believe so no. I might be wrong

1

Make sure its in a server script not a local script.

0

aight i was doing it wrong unfortunately it fixed when i did color3.new instead of color3.fromHSV

This discussion is preserved as it was. New answers, comments, and votes are closed.