So basically, if my boolvalue is true it'll play the loop which is what I want! Now the problem is.... I have this repeat loop, and I'm trying to make it so that it will keep on Looping UNITL the boolvalue is false. And I sneaked in a boolvalue.Value = false, yet confusingly it KEEPS on looping???
Here is the script:
01 | local boolvalue = script.Parent.Value |
02 | local light = game:GetService( "Lighting" ) |
03 | local alarm = script.Parent.Parent.alarm |
04 | local message = script.Parent.Parent.corevent |
05 | local temp = script.Parent.SurfaceGui.Text |
06 | while true do |
07 | wait() |
08 |
09 | if temp.Text = = "2000°c" then |
10 | script.Parent.Parent.Map.coremachine.coreOverheat.Fire.Enabled = true |
11 | alarm.Looped = true |
12 | boolvalue.Value = true |
13 | end |
14 | if boolvalue.Value = = true then |
15 | message:Play() |
01 | local boolvalue = script.Parent.Value |
02 | local light = game:GetService( "Lighting" ) |
03 | local alarm = script.Parent.Parent.alarm |
04 | local message = script.Parent.Parent.corevent |
05 | local temp = script.Parent.SurfaceGui.Text |
06 |
07 | local function change(v) |
08 | if (v = = true ) then |
09 | message:Play() |
10 |
11 | repeat |
12 | light.Ambient = Color 3. new( 150 / 255 , 0 / 255 , 0 / 255 ) |
13 | alarm:Play() |
14 | wait( 0.2 ) |
15 | light.Ambient = Color 3. new( 0 / 255 , 0 / 255 , 0 / 255 ) |
Put until boolvalue.Value == false
somewhere above boolvalue.Value = false
see if that helps.
Try using this
01 | local boolvalue = script.Parent.Value |
02 | boolvalue = true --an example to set it |
03 |
04 | if boolvalue = = true then |
05 | --run code |
06 | boolvalue = false |
07 | end |
08 |
09 | if boolvalue = = false then |
10 | --run code |
11 | boolvalue = true |
12 | end |
Good Luck!