im making a kind of music box system like fnaf 2 and I need the text to change to a number value. how do I do this? here's what I have
local Number = script.Parent.Parent.Parent.Parent.Value local Text = script.Parent if true then Text.Text = Number end
and heres my timer script
local Number = script.Parent.Value local saliAI = workspace.AI.Sali.pathfind if true then Number.Value = Number.Value - 1 wait(3) end
If this is like the music box system, then I assume this number will constantly be winding down. It is for this reason that we should use the .Changed event
What is does is tell us when the value has changed. In this case, we would listen to when the numbervalue changes and update the text value to the new number.
local Number = script.Parent.Parent.Parent.Parent local Text = script.Parent Number.Changed:Connect(function() Text.Text = tostring(Number.Value) end)