Raised This Month: $12 Target: $400
 3% 

[L4D2] VScript help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alcybery
Member
Join Date: Apr 2016
Old 07-12-2018 , 12:12   [L4D2] VScript help
Reply With Quote #1

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:
PHP Code:
weaponsToConvert =
    {
        
weapon_pistol =     "weapon_molotov_spawn"
    
}

    function 
ConvertWeaponSpawnclassname )
    {
        
local chance RandomInt(0100 )
        if( 
chance 50 )
        {
            if ( 
classname in weaponsToConvert )
            {
                return 
weaponsToConvert[classname];
            }
        }
        return 
0;
    } 
I added this to director_base.nut, packed this file in vpk with scripts\vscripts path.

final director_base.nut


This doesn't work, error log:
Spoiler


What am I doing wrong?
alcybery is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode