NTTest.nt
Code:
function NTMain()
{
Include("libs/common/NTCommon.ntl");
NTC_IncludeLibs();
NTC_IncludeConfig("NTBot/char_configs");
NT_LoadConfig();
NTA_Initialize();
me.maxgametime = 0;
var _test = "hallo"; // <-- die variable
NT_Hallo(); // <-- funktionsaufruf
while(true)
{
Delay(500);
}
NTC_SendMsgToScript("MWBotGame.ntj", "SCRIPT_END");
}
function NT_Hallo() // <-- funktion
{
Print(_test); // <-- hier wird _test verwendet
}
Warum bekomme ich diese Fehlermeldung?
English: In the above script I try to access the variable _test via the function NT_Hallo(), however on running the script it leads to an error: <D2NT Error> C:\Users\tonk\Desktop\D2NT 3.1\Muddy's\scripts\NTBot\bots\NTTest.ntj (28): ReferenceError: _test is not defined. Why does the error occur?







