Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I convert a string value into a Vector3 value?

Asked by 5 years ago
Edited 5 years ago

I'm trying to design a keypad to change a Vector3 value for a mesh. The only issue is when the I try to change the Vector3 value through a script. It remains the same.

keypad.Show.ClickDetector.MouseClick:Connect(function(player) --Displays player's Vector3 value.
    Input = tostring(player.DATA.HairColor.Value)
    Go(player) --Just puts the input value on display.
end)

keypad.Enter.ClickDetector.MouseClick:Connect(function(player) --Gives player displayed value.
    player.DATA.HairColor.Value = Vector3.new(tonumber(Input))
end)

I've tried using tostring and tonumber to convert the value to a string and back to a value for display.Converting it to a string seems to work fine, its only when converting it to Vector3 that nothing happens. Is there something I'm missing?

1
yes,tonumber converts a thing into a number or nil, meaning that if you have anything besides numbers , it will be nil theking48989987 2147 — 5y
0
Also, colors should be color3 values, not vector3 values theking48989987 2147 — 5y

Answer this question