✓ Accepted answer
Here is A Script This May Work
local intermission1v1 = script.Parent
intermission1v1:GetPropertyChangedSignal("Enabled"):Connect(function(bool)
if bool then
for i = 1,-30,1 do
wait(1)
script.Parent.Text = i
end
end
end)
ok so since you said you don't understand if statements.
here is a video I recommend you watch to get a better perspective : (http://https://www.youtube.com/watch?v=5iQTzOaMjwE)
also on line one that would not be considered a function, not an if statement because your using the
:Connect
line 2 is checking if the UI is enabled
line 3 you had it a certain way before on the for I loop
so if you have your values 1,-30,1
the first number is the start value know as the start value that's how many times it repeats
so if you put that value as 2 you would have -60 and if you keep adding that up it would go on forever
and on the middle value known as the end value that's how many times the loop repeats
the increment value know as the last int this is from the dev hub :If the optional increment value is included in the statement, a positive value will count up while a negative value will count down
hope this helps! and i hope i explained this well!
3 comments
thanks for explaining it that helped alot! but when i put the script in it said that "Enabled is not a valid property name" for some reason but ill try to fix it
ok i recomend using the . changed function so intermission1v1.Changed:Connect(function()
i have tryed to do it using the :GetPropertyChangedSignal() and it usally fails