UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Not spawning back with a gun

broken avatar :(
Created 9 years ago
by nabaro
0 Members and 1 Guest are viewing this topic.
2,123 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
When testing my map in multiplayer, after a player dies out and spawns back in, he does not spawn in with a gun. I've tried looking through the scripts for respawning and I can't find the part where the gun is given back. If it helps, I have replaced the Colt with the Tac-45. Upon initial spawn in, all players are given the Tac-45 and everything functions normally until they bleed out and spawn back. Thanks in advance for your help!
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 20 September 2013
Last active: 3 years ago
Posts
130
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Signature
Stupid, but it works.
×
X0master's Groups
X0master's Contact & Social LinksslayerbeastWar_gunner12YubLannights35
it maybe it had to do with this in _zombiemode_weapons?  if( primaryWeapons == "zombie_colt" ) if it is then change zombie colt with the name of your beginning weapon
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
Code Snippet
Plaintext
if( primaryWeapons[i] == "zombie_tac45" )
{
continue;
}

I already did this for a separate issue.
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 5 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
Signature
Projects:
Unnamed Project: 5%
Mutliple Downloadable Items for Mappers: (Released after map releases)
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406Gerard0406GerardS0406MrGerard0406
Code Snippet
Plaintext
if( primaryWeapons[i] == "zombie_tac45" )
{
continue;
}

I already did this for a separate issue.
All I did was change all of the zombie_colt's in _loadout.gsc to my starting pistol and worked perfectly
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
How did you change out your starting pistol?

Are you giving it at start of game somewhere? Did you edit your loadout?

My loadout doesn't work like the stock one anymore but if I remember correctly add_weapon(your weapon), set_laststand_pistol(your weapon), and set_switch_weapon( your weapon ) are the key parts to look at under the getdvar( "zombiemode" ) section, for the starting and laststand pistols, as well as respawn I think.
Marked as best answer by nabaro 9 years ago
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
YaPhil made a fix for this, it's a pretty common issue (even if you don't use a custom starting pistol)
Paste this anywhere in your mapname.gsc -

Code Snippet
Plaintext
// Attempts to fix the "no gun on respawn" error
give_gun_on_spawn_think()
{
    self endon("disconnect");
    flag_wait("all_players_spawned");
    //iPrintLn("Running loop on player " + self GetEntityNumber());
    while(true)
    {
        self waittill("spawned_player");
        wait_network_frame();
        wait(3);
        //iPrintLn("Giving a weapon to respawned player " + self GetEntityNumber());
        self GiveWeapon("zombie_tac45");
        self SwitchToWeapon("zombie_tac45");
    }
}

And add this line somewhere after _zombiemode::main()

Code Snippet
Plaintext
array_thread(get_players(), ::give_gun_on_spawn_think);
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
Thank you! This ^ fixed it.

 
Loading ...