Help? I am trying to make it so when the soundId changes, on the button it will count down from 125 on the scripts parents text. This wont work?
function onChanged() local Time = 125 for i = Time, 0, -1 do Time = i wait(1) end script.Parent.Text = tostring(Time) end script.Parent.Parent.ScrollingFrame.Sound.SoundId:connect(Changed)
Haven't tested but im pretty sure I didnt make any errors
local CountDownFrom = 125 script.Parent.MouseButton1Click:connect(function() for i = 0,CountDownFrom,1 do script.Parent.Text = CountDownFrom - i wait(1) end end)
for on Sound Id Change (didnt test this one either)
local CountDownFrom = 125 script.Parent.Parent.ScrollingFrame.Sound.SoundId.Changed:connect(function() for i = 0,CountDownFrom,1 do script.Parent.Text = CountDownFrom - i wait(1) end end)
+1 pl0x?
Perhaps I'm mistaken, but I'm under the impression that you simply set the text to the given time on the wrong line -- You placed it after the loop...
script.Parent.MouseButton1Down:connect(function() local Time = 125 for i = Time, 0, -1, do script.Parent.Text = tostring(Time) Time = i wait(1) end end