A system of tasks I'm trying to design, the problem is that I don't understand why the "if" functions aren't performed by the script.
- No errors given
- Regular script
- Feel free to ping me if I'm not responding
- If you know what I'm doing wrong or how I can improve the script it would be greatly appreciated.
**- FULL SCRIP: **
`local Task1 = "N/A"
local Task2 = "Reach temp of: "
local Time1 = script.Parent.Time1.Value
local Temp1 = script.Parent.Temp1
function NewLoop()
while true do
local Randomtask = math.random(1,2)
local Time = math.random(10,35)
local Temp = math.random(20,10000)
if Randomtask == 1 then
script.Parent.Main.T1.Text = Task1
local n = math.random(5,6)
Time1 = n
script.Parent.Main.Time1.Text = "N/A"
wait(Time1)
NewLoop()
end
if Randomtask == 2 then
script.Parent.Main.T1.Text = Task2..(Temp).."c"
script.Parent.Parent.Sound:Play()
for i = Time, 0, -1 do
script.Parent.Main.Time1.Text = i
wait(1)
if Temp == Temp1 then
script.Parent.Main.One.TextColor3 = Color3.new(0.196078, 0.666667, 0.227451)
script.Parent.Main.T1.TextColor3 = Color3.new(0.196078, 0.666667, 0.227451)
script.Parent.Main.Time1.TextColor3 = Color3.new(0.196078, 0.666667, 0.227451)
wait(15)
NewLoop()
if i == 0 then
script.Parent.Main.One.TextColor3 = Color3.new(1, 0.0666667, 0.0666667)
script.Parent.Main.T1.TextColor3 = Color3.new(1, 0.0666667, 0.0666667)
script.Parent.Main.Time1.TextColor3 = Color3.new(1, 0.0666667, 0.0666667)
wait(5)
NewLoop()
end
end
end
end
end
end
NewLoop()`