while true do if script.Parent.Text:match("%d+") then script.Parent.Value.Value = script.Parent.Text wait(1) end end
Its supposed to check if a text is an integer, and if that text is an integer its supposed to put that integer into a numbervalue.
When I check numbervalue it reads back as 0.
local num while true do num = tonumber(script.Parent.Text) -- attempt to convert text to number if num then -- if non-nil, it was successful and 'num' equals the number script.Parent.Value.Value = num end wait(1) end
Trying using string.gmatch.
while wait(1) do if string.gmatch(script.Parent.Text, "%d+") then script.Parent.Value.Value = script.Parent.Text end end