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

Custom Weapon Script Help

broken avatar :(
Created 11 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
2,195 views
broken avatar :(
×
broken avatar :(
Location: 00
Date Registered: 2 November 2016
Last active: 9 years ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
natesmithzombies's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
natesmithzombies's Contact & Social LinksNSmithZombies
My end goal for this script is to make the crossbow impact point spawn a power up, but I am crawling at a snail's pace to get this done.  I made a function to test to see if the script is working the way I want, but it will not print that the crossbow has been fired. The crossbow is ported and is definitely called "crossbow". Below is my script :

Code Snippet
Plaintext
// Custom Weapon Script 

#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_net;

#using_animtree( "generic_human" );

init()
{
level thread load_on_player_connect();
}

load_on_player_connect()
{
for( ;; )
{
level waittill( "connecting", player );
player thread wait_for_gun_fired();
}
}

wait_for_gun_fired()
{
self endon( "disconnect" );
self waittill( "spawned_player" );

for( ;; )
{
self waittill("projectile_impact", weapon, location );

if ( weapon != "crossbow" )
{
continue;
}

if ( weapon == "crossbow" )
{
self thread gun_fired();
}
}
}

gun_fired()
{
iprintlnbold ("The Crossbow Has Been Fired");
}

I can get the message to print to screen if I switch
Code Snippet
Plaintext
 self waittill("projectile_impact", weapon, location ); 

with

Code Snippet
Plaintext
self waittill( "weapon_fired" ); 
getweapon = self GetCurrentWeapon();
if( getweapon == "crossbow" )
{
self thread gun_fired();
}
 

but I know that in the long run I will not be able to obtain the location of the impact to spawn the power up without using
Code Snippet
Plaintext
self waittill("projectile_impact", weapon, location ); 
. Also I don't know how to spawn a power up either, so help would be appreciated there too. Thanks guys.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
Is the crossbow actually set as a projectile-weapon in the weapon file?
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Code Snippet
Plaintext
level thread maps\_zombiemode_powerups::powerup_drop( power_up_origin );
This will generate a random drop.

For max ammo like dog round:
Code Snippet
Plaintext
		level.zombie_vars["zombie_drop_item"] = 1;
level.powerup_drop_count = 0;
level thread maps\_zombiemode_powerups::powerup_drop( power_up_origin );
Last Edit: August 18, 2015, 05:50:08 am by DidUknowiPwn

 
Loading ...