Give weapon to only one person script

broken avatar :(
Created 9 days ago
by ERAWEX
0 Members and 1 Guest are viewing this topic.
68 views
broken avatar :(
×
broken avatar :(
Location: ch
Date Registered: 28 March 2017
Last active: 1 hour ago
Posts
41
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ERAWEX's Groups
ERAWEX's Contact & Social Links
Hi there,

Im looking to give the player who triggers the trigger a weapon as part of an easter egg. 

I have a script that works but if one player triggers the trigger all players in the game get the weapon. 

eeScript()
{
    eeTrigger = GetEnt("ee_trigger", "targetname");
        eeTrigger waittill("trigger");
        eeTrigger Delete();
        players = get_players();
        for(i=0;i<players.size;i++)
        {
        players[i] GiveWeapon("tesla_gun_upgraded");
        players[i] SwitchToWeapon("tesla_gun_upgraded");
    }
}
Would anyone know how to modify the script in order to only give the weapon to the person/player who triggers the trigger?
Thanks for any help.
ERAWEX
Marked as best answer by ERAWEX on Today at 05:13:23 pm
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 3 days ago
Posts
1,186
Respect
1,390Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
[RELEASED] Greenhouse Realism 3.0: [You are not allowed to view external links. Register or Login to see them]

NUK370WN Realism 3.0: [You are not allowed to view external links. Register or Login to see them]
Industrial Estate Realism 3.0: [You are not allowed to view external links. Register or Login to see them]

Support my work here:  [You are not allowed to view external links. Register or Login to see them]
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
eetrigger = getent( "eetrigger", "targetname" );
eetrigger waittill ("trigger", player);
eetrigger delete;
player giveweapon( "tesla_gun_upgraded" );
broken avatar :(
×
broken avatar :(
Location: ch
Date Registered: 28 March 2017
Last active: 1 hour ago
Posts
41
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ERAWEX's Groups
ERAWEX's Contact & Social Links
Worked out great! Thanks.

 

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
Loading ...