This doesn't disable the script as expected, but continues to run, but why?
I'm working on a script for a game, and the script won't disable itself as needed for proper functionality in the game. That print message in the end of the if statement ends up happening after the script should be disabled. I have also tried making other scripts disable this one, and checked all other scripts for something enabling it, but it just doesn't disable. It continues to run when it should not.
01 | if Temp.Value > = MeltdownUpperLimit then |
02 | Status.Value = "Meltdown" |
03 | Warn.Value = "Core Meltdown Imminent! Evacuate Now!" |
04 | script.Parent.Parent.Parts.Core.PointLight.Color = Color 3. fromRGB( 255 , 0 , 0 ) |
05 | script.Parent.Parent.Parts.Core.BrickColor = BrickColor.new( "Really red" ) |
06 | script.Parent.Meltdown.Disabled = false |
07 | script.Parent.ExplosionSounds.Disabled = false |
08 | script.Disabled = true |
09 | print ( "Bug Test: gamne.Workspace.Core.Scripts.TempIncrementing: Line 133; Script Not Disabled as Expected." ) |