I'm making a story game and I'm trying to make a countdown that shows how much time is left before the car leaves so I make a number value and it doesn't work.
This is code assuming that you want to change textlabel that is in Gui:
local Player = game.Players.LocalPlayer local NumberValue = game.Workspace.NumberValue -- Path to NumberValue local Countdown = Player:WaitForChild("CountDown").TextLabel -- Path to Textlabel Countdown.Text = tostring(NumberValue.Value) -- Set it for the first time NumberValue:GetPropertySignalChanged("Value"):Connect(function() -- Awoid while wait() do loop in this case as this is better on performance Countdown.Text = tostring(NumberValue.Value) end)
make the number value become the script's parent
change the number value parent to a text label
you can do this (script):
local numvalue = script.Parent local text = script.Parent.Parent local countdown = 20 while wait() do numvalue.Value = countdown repeat text.Text = numvalue.Value numValue.Value = numValue.Value - 1 wait until countdown == 0 end
sorry for the late response :P please mkar this as the correct answer is that helped you, ill check this out later, bye 8)