My script spits out Workspace.Manage.RoomCheck:10: attempt to call global 'check' (a nil value) What's going on?
Here's my code
01 | -- Room Checker Script |
02 | local boardRooms = game.Workspace.Manage.SurfaceGui.Rooms |
03 | local roomDbase = game.ReplicatedStorage.RoomDatabase.Standard |
04 | Ok = Color 3. new( 0 , 184 , 6 ) |
05 | Ta = Color 3. new( 184 , 0 , 0 ) |
06 |
07 | repeat |
08 | wait( 15 ) |
09 | -- Normal Rooms |
10 | check( "101" ) |
11 | check( "102" ) |
12 | check( "103" ) |
13 | check( "104" ) |
14 | check( "105" ) |
15 | check( "106" ) |
You probably figured it out, but if you don't want to put the function in a certain order you can also put at the top of script
1 | local check |
So long as you finish defining it before you end up calling it. You can do that with your script by enclosing the lines 2 to 41 in a function and calling that function as the very last line of the script