01 | currentTemp = game.Workspace:WaitForChild( "TemperatureValue" ) |
02 | AlarmMinorS = game.Workspace.AlarmMinor |
03 | AlarmMajorS = game.Workspace.AlarmMajor |
04 | MainframeStatus = game.Workspace.MainframeStatus.SurfaceGui.TextLabel |
05 |
06 | function alarmMinor() |
07 | if currentTemp.Value > = 700 then |
08 | AlarmMinorS:Play() |
09 | AlarmMajorS:Stop() |
10 | -- |
11 | MainframeStatus.Text = "LavaBlast://Core_Status/Issue" |
12 | MainframeStatus.TextColor 3 = Color 3. new( 255 , 85 , 0 ) |
13 | -- |
14 | local firethree = workspace.Mainframe_Status_Fire_Parts:GetChildren() |
15 | for i = 1 , #firethree do |
And this is the error:
1 | 21 : 10 : 17.277 - Workspace.Meltdown Detector: 79 : attempt to call global 'normalTemperature' (a nil value) |
2 | 21 : 10 : 17.277 - Stack Begin |
3 | 21 : 10 : 17.277 - Script 'Workspace.Meltdown Detector' , Line 79 |
4 | 21 : 10 : 17.278 - Stack End |
5 | -- Also line 79 is "normalTemperature()" |
I don't know what is wrong. Please help asap! :)
Merely is correct. Based on the positioning of your ends
, the second function is only defined after the first is called, and the third only after the second! Also, there appears to be an extra 'end'.
This is very easy to see if you properly indent and un-indent your lines:
01 | --snip |
02 |
03 | function alarmMinor() |
04 | if currentTemp.Value > = 700 then |
05 | --snip |
06 | for i = 1 , #firethree do |
07 | --snip |
08 | for i = 1 , #mainframelights do |
09 | --snip |
10 | end |
11 | end |
12 | end |
13 |
14 | function alarmMajor() |
15 | if currentTemp.Value > = 1000 then |
That error occurs when you try to call a function that you haven't defined.
For example:
1 | testFunction() |
15:31:01.765 - testFunction():1: attempt to call global 'testFunction' (a nil value)