I don't know if it's the correct place to post this, since it is not about sourcemod.
I'm trying to modify VScript to randomly replace weapon spawns, for example this should replace pistols with molotovs with 50% chance:
function GetDirectorOptions()
{
local result;
if ( "DirectorOptions" in DirectorScript )
{
result = DirectorScript.DirectorOptions;
}
if ( DirectorScript.MapScript.rawin( "DirectorOptions") )
{
if ( result != null )
{
delegate result : DirectorScript.MapScript.DirectorOptions;
}
result = DirectorScript.MapScript.DirectorOptions;
}
if ( DirectorScript.MapScript.LocalScript.rawin( "DirectorOptions") )
{
if ( result != null )
{
delegate result : DirectorScript.MapScript.LocalScript.DirectorOptions;
}
result = DirectorScript.MapScript.LocalScript.DirectorOptions;
}
if ( DirectorScript.ChallengeScript.rawin( "DirectorOptions") )
{
if ( result != null )
{
delegate result : DirectorScript.ChallengeScript.DirectorOptions;
}
result = DirectorScript.ChallengeScript.DirectorOptions;
}
return result;
}
This doesn't work, error log:
Spoiler
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
Connection to Steam servers successful.
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
VAC secure mode is activated.
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]