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

Help with giving a weapon through script.

broken avatar :(
Created 7 years ago
by HyperFirez
0 Members and 1 Guest are viewing this topic.
2,152 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Signature
Maps:
Standoff Zombies [WIP]
Der Blitzdrache [WIP] (Maybe Canceled)
FNAF 1-4 [WIP] (Maybe Canceled)
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
As most of you know, I am making a gobblegum script. I am having trouble giving the player the gumball though: Script

Double Post Merge: January 08, 2017, 12:17:05 am
I have a bunch of random code commented out and I think 1 if statement with no params, because idk what to put there.
Last Edit: January 08, 2017, 12:17:05 am by HyperFirez
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2014
Last active: 3 years ago
Posts
103
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
Signature
Dead Palace
×
Riptide1106's Groups
Riptide1106's Contact & Social Links
let me leave you a function of mine i've used to give a weapon... maybe that will give you a jump start for your own script.
Code Snippet
Plaintext
my_bonus()
{
my_reward_trig = getEnt("my_reward_trig", "targetname");
self setCursorHint("HINT_NOICON");
my_reward_trig waittill("trigger", user);
{
players = get_players();
for(i=0;i<players.size;i++)
if( players[i].playername == "Riptide1106" )
{
player = players[i];
weapon = player getcurrentweapon();
weap = player GetWeaponsListPrimaries();
if(weap.size <= 1)
{
player giveweapon("thunderg");
player switchtoweapon("thunderg");
}
if(weap.size >=2)
{
player takeweapon(weapon);
player giveweapon("thunderg");
player switchtoweapon("thunderg");
}
my_reward_trig delete();
}
}
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
let me leave you a function of mine i've used to give a weapon... maybe that will give you a jump start for your own script.
Code Snippet
Plaintext
my_bonus()
{
my_reward_trig = getEnt("my_reward_trig", "targetname");
self setCursorHint("HINT_NOICON");
my_reward_trig waittill("trigger", user);
{
players = get_players();
for(i=0;i<players.size;i++)
if( players[i].playername == "Riptide1106" )
{
player = players[i];
weapon = player getcurrentweapon();
weap = player GetWeaponsListPrimaries();
if(weap.size <= 1)
{
player giveweapon("thunderg");
player switchtoweapon("thunderg");
}
if(weap.size >=2)
{
player takeweapon(weapon);
player giveweapon("thunderg");
player switchtoweapon("thunderg");
}
my_reward_trig delete();
}
}
}
Ayy, thanks m8.

Double Post Merge: January 08, 2017, 05:39:28 am
I'm still having issues.

Double Post Merge: January 08, 2017, 03:25:41 pm
Is there a way to check if a player is pressing a specific button?

Double Post Merge: January 08, 2017, 05:51:48 pm
This is what I have so far:
Code Snippet
Plaintext
gum_think()
{
//gumball_machine = getEnt("gumball_machine","targetname");
//gumball_machine waittill("trigger", user);
players = get_players();

for(i=0;i<players.size;i++)
{
player = players[i];
player SetActionSlot( 5, "weapon", "zombie_gumball" );
uses = getAmmoCount( "zombie_gumball" );
//weapon = player getcurrentweapon();
//weap = player GetWeaponsListPrimaries();
if()
{
player giveweapon("zombie_gumball");
continue;
}

if(player isFiring("zombie_gumball"))
{
player switchToOffHand("zombie_gumball");
}

if(uses < 1)
{
player takeweapon("zombie_gumball");
}
wait(0.5);
}
}
Last Edit: January 08, 2017, 05:51:48 pm by HyperFirez
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
respect the dead

donates greatly appreciated :) paypal.me/F3ARxReaper666
discord server:
https://discord.gg/tsGHW99
×
death_reaper0'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.
could be wrong but im pretty sure waw only has 4 actionslots
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
could be wrong but im pretty sure waw only has 4 actionslots
It has 3, assigned to 4 5 & 6
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
no it has all 4

one just doesnt show on the hud
Last Edit: January 08, 2017, 11:12:53 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
no it has all 4

one just doesnt show on the hud
Oh, I see. Even if I tell it to give me the weapon on the moment I spawn, it doesn't...

 
Loading ...