So i have a “timer” that counts down from 2 minutes, I want a smoke effect to start working when the text on the timer is on 1 minute, Here is the script i thought would help but isnt working at all:
local smoke = script.Parent:FindFirstChild(“Smoke”)
smoke.Enabled = false
local timerLabel = script.Parent.Parent.Parent.Timer.SurfaceGui.Frame.TextLabel
while true do
if timerLabel.Text == “1:00” then
smoke.Enabled = true
break – Exit the loop once the condition is met
end
wait(1) – Check every second
end
if i were you i would use an integervalue to count down from 2 minutes, with the text only displaying the time instead of being a variable (if timerLabel.RemainingTime.Value <= “60” then)
local smoke = script.Parent:FindFirstChild(“Smoke”)
smoke.Enabled = false
local timerLabel = script.Parent.Parent.Parent.Timer.SurfaceGui.Frame.TextLabel
timerLabel:GetPropertyChangedSignal("Text"):Once(function()
if timerLabel.Text == "1:00" then
smoke.Enabled = true
end
end)
local smoke = script.Parent:FindFirstChild(“Smoke”)
smoke.Enabled = false
local timerLabel = script.Parent.Parent.Parent.Timer.SurfaceGui.Frame.TextLabel
local timerv = timerLabel.TimeLeft --integer value btw
while timerv.Value > 0 do
timerv.Value -= 1
task.wait(1)
-- idk how to make a number go into minutes so you figure that out :D
end
--smoke part
if timerv.Value == 60 then
smoke.Enabled = true
end