[Support] More than one custom GSC script?
-
I already have the unlimited perks gsc but I have been trying to figure out how to add a second one (using gsc studio) I can't add another file called _clientids.gsc to the folder because obviously it will overwrite and if i try to add the script beneath the original it doesn't work I've also tried adding a new script file next to the main but that doesn't work either. any help would be much appreciated
-
If zombies use _zm_bot.gsc place it in maps/mp/zombies. If you don't have a copy of it the contents are very limited anyway:
#include maps/mp/zombies/_zm_utility; #include maps/mp/_utility; #include common_scripts/utility; init() { /# println( "ZM >> Zombiemode Server Scripts Init (_zm_bot.gsc)" ); #/ }
For multiplayer I would use _shellshock.gsc since its fairly small and its contents look like this:
#include common_scripts/utility; #include maps/mp/_utility; init() { precacheshellshock( "frag_grenade_mp" ); precacheshellshock( "damage_mp" ); precacherumble( "artillery_rumble" ); precacherumble( "grenade_rumble" ); } shellshockondamage( cause, damage ) { if ( self maps/mp/_utility::isflashbanged() ) { return; } if ( cause != "MOD_EXPLOSIVE" && cause != "MOD_GRENADE" && cause != "MOD_GRENADE_SPLASH" || cause == "MOD_PROJECTILE" && cause == "MOD_PROJECTILE_SPLASH" ) { time = 0; if ( damage >= 90 ) { time = 4; } else if ( damage >= 50 ) { time = 3; } else if ( damage >= 25 ) { time = 2; } else { if ( damage > 10 ) { time = 2; } } if ( time ) { if ( self mayapplyscreeneffect() ) { self shellshock( "frag_grenade_mp", 0.5 ); } } } } endondeath() { self waittill( "death" ); waittillframeend; self notify( "end_explode" ); } endontimer( timer ) { self endon( "disconnect" ); wait timer; self notify( "end_on_timer" ); } rcbomb_earthquake( position ) { playrumbleonposition( "grenade_rumble", position ); earthquake( 0.5, 0.5, self.origin, 512 ); }
Alternatively, if you have access to the source of the scripts you can attempt to merge them into one mod.
-
Trizz if you are adding a new script, make sure you call the new script under OnPlayerSpawned.
self waittill("spawned_player"); self thread <scriptname>;
Note that this works for MOST scripts and not all. I would highly recommend researching gsc. There are tons of resources out there. Even with only basic knowledge of gsc , you should be able to handle these things on your own.
really good gsc tutorial: https://www.nextgenupdate.com/forums/black-ops-2-gsc-mods-scripts/764127-tutorial-basic-gsc-scripting.html
-
Cahz I'm trying to add a script to this would it go at the bottom and if so how would i put it? I'm not trying to be spoonfed I'm just sort of struggling tbh
-
Can you explain what you are trying to add so we can better assist? Are you trying to spawn with perks/a gun, etc?
-
In that perk limit script, there is only one significant line, the rest don't mean anything.
So maybe just transfer that one significant line (level.perk_purchase_limit = 9;
) into that other script you're trying to use. -
why are you trying to add multiple GSC files? you can put basically an infinity amount of code into a single GSC file. you dont need multiple just to add a new script
-
Ducxy how would i start the second script though? like just start on the line after or something. ted I'm trying to add jugg at round one just for the example for myself so i can see how it's done. then after that works i'm gonna see if there is anything i can do about adding a max ammo refills clip script.
-
ted The top works but the bottom don't basically
-
Trizz It's not going to work because you've just copy and paste'd both into one file. You're calling functions with the same name but to do different things.
I don't know how to explain it without confusing you more so just use this instead:
#include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\zombies\_zm; #include maps\mp\zombies\_zm_utility; init() { level.clientid = 0; level.perk_purchase_limit = 9; level thread onplayerconnect(); } onplayerconnect() { for ( ;; ) { level waittill( "connecting", player ); player.clientid = level.clientid; player thread onplayerspawned(); level.clientid++; } } onplayerspawned() { level endon( "game_ended" ); self endon( "disconnect" ); for(;;) { self welcome(); } } welcome() { self waittill( "spawned_player" ); self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" ); wait 7; self iprintln("^2" +self.name + "^7 , your perk limit has been removed"); }
-
ted said in More than one custom GSC script?:
#include maps\mp_utility;
#include common_scripts\utility;
#include maps\mp\zombies_zm;
#include maps\mp\zombies_zm_utility;init()
{
level.clientid = 0;
level.perk_purchase_limit = 9;
level thread onplayerconnect();
}onplayerconnect()
{
for ( ;; )
{
level waittill( "connecting", player );
player.clientid = level.clientid;
player thread onplayerspawned();
level.clientid++;
}
}onplayerspawned()
{
level endon( "game_ended" );
self endon( "disconnect" );for(;;)
{
self welcome();
}
}welcome()
{
self waittill( "spawned_player" );
self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
wait 7;
self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
}Thanks for the script. I will try to practice some more, i appreciate it