Thanks man that worked ill give you some credit in my map description once its updated! Double Post Merge: October 15, 2016, 12:30:44 amThe script works but after testing it on multiplayer it gives the shield to only 1 player and not all players. Is theirs a way to script it to all players or all 4? Double Post Merge: October 15, 2016, 12:31:42 amholly fuck i was baked when I wrote that
Replace this:
Code Snippet
Plaintext
player zm_equipment::give(equipment);
With this:
Code Snippet
Plaintext
players = GetPlayers();
for(i=0; i < players.size; i++) { players[i] zm_equipment::give(equipment); }
Last Edit: October 15, 2016, 09:19:24 am by reckfullies
for(i=0; i < players.size; i++) { players[i] zm_equipment::give(equipment); }
Thanks man but im currently having a glitch where sometimes the script bugs out and does not fully work and you only have to shoot 1 trigger and it gives you the Easter egg complete status. This is my code
function shootables_done(player) { while(1) { self waittill(level.shootablesCollected >= level.shootablesNeeded);
if(level.shootablesCollected == level.shootablesNeeded) { // What ever code you want to execute once all shootables are collected IPrintLn("Easter Egg Complete. Enjoy your new shield!"); equipment = GetWeapon("zod_riotshield"); players = GetPlayers();
for(i=0; i < players.size; i++) { players[i] zm_equipment::give(equipment); } }
I've noticed that when you done shooting all of the triggers only the first player gets the rewards and other three players don't. Is there a fix for this?
function shootables_done(player) { while(1) { self waittill(level.shootablesCollected >= level.shootablesNeeded);
if(level.shootablesCollected == level.shootablesNeeded) { // What ever code you want to execute once all shootables are collected IPrintLn("All Shootables Collected"); player zm_perks::give_perk( PERK_ELECTRIC_CHERRY, false ); }
break; } }
Tested and it works fine
This is for 3 triggers
Using the exact same code (other than different print messages), I'm getting the following error when linking in launcher:
^1� ^1^ ^1ERR(0) scripts/custom/shootable.gsc (16,1) in "shootable_1()" : Bad Token '�' : ^1� ^1^ ^1ERR(0) scripts/custom/shootable.gsc (16,1) in "shootable_1()" : syntax error, unexpected TOKEN_ERROR : �
I've noticed that when you done shooting all of the triggers only the first player gets the rewards and other three players don't. Is there a fix for this?
Code Snippet
Plaintext
function shootables_done(player) { while(1) { self waittill(level.shootablesCollected >= level.shootablesNeeded);
im having a glitch with my script where you don't need to shoot all 3 objects to get the easter egg complete. Sometimes its only 1 or 2 triggers you only need to shoot.
im having a glitch with my script where you don't need to shoot all 3 objects to get the easter egg complete. Sometimes its only 1 or 2 triggers you only need to shoot.
This shouldn't be possible since it checks twice if they are all activated, anyways try this.
Replace:
Code Snippet
Plaintext
function shootables_done() { while(1) { self waittill(level.shootablesCollected >= level.shootablesNeeded);
if(level.shootablesCollected == level.shootablesNeeded) { // What ever code you want to execute once all shootables are collected IPrintLn("All Shootables Collected"); }
break; } }
with:
Code Snippet
Plaintext
function shootables_done() { self waittill(level.shootablesCollected >= level.shootablesNeeded);
while(1) { if(level.shootablesCollected == level.shootablesNeeded) { // What ever code you want to execute once all shootables are collected IPrintLn("All Shootables Collected");
break; } } }
Last Edit: October 19, 2016, 12:00:04 am by reckfullies
function shootables_done() { self waittill(level.shootablesCollected >= level.shootablesNeeded);
while(1) { if(level.shootablesCollected == level.shootablesNeeded) { // What ever code you want to execute once all shootables are collected IPrintLn("Here is your reward!"); player zm_perks::give_perk( PERK_ELECTRIC_CHERRY, false );
break; } } }
Last Edit: October 20, 2016, 05:43:50 pm by M0ul3_G4m3r
function shootables_done() { self waittill(level.shootablesCollected >= level.shootablesNeeded);
while(1) { if(level.shootablesCollected == level.shootablesNeeded) { // What ever code you want to execute once all shootables are collected IPrintLn("Here is your reward!"); player zm_perks::give_perk( PERK_ELECTRIC_CHERRY, false );
break; } } }
Just as the error says, you didn't initialize the variable player.
There are 2 ways you can do this depending on who you want to give the perk to.
All Players:
Spoiler: click to open...
Code Snippet
Plaintext
function shootables_done() { self waittill(level.shootablesCollected >= level.shootablesNeeded);
function shootables_done(player) { while(1) { self waittill(level.shootablesCollected >= level.shootablesNeeded);
if(level.shootablesCollected == level.shootablesNeeded) { // What ever code you want to execute once all shootables are collected IPrintLn("All Shootables Collected");
player zm_perks::give_perk( PERK_ELECTRIC_CHERRY, false );
break; } } }
Last Edit: October 20, 2016, 06:11:13 pm by reckfullies