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

Give weapon to only one person script

broken avatar :(
Created 4 years ago
by ERAWEX
0 Members and 1 Guest are viewing this topic.
1,327 views
broken avatar :(
×
broken avatar :(
Location: ch
Date Registered: 28 March 2017
Last active: 1 year ago
Posts
51
Respect
Forum Rank
Rotting Walker
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.

Code Snippet
Plaintext
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 4 years ago
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +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
×
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 year ago
Posts
51
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
ERAWEX's Groups
ERAWEX's Contact & Social Links
Worked out great! Thanks.
broken avatar :(
×
broken avatar :(
Location: grgreece
Date Registered: 8 May 2020
Last active: 2 years ago
Posts
6
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
bonse2000's Groups
bonse2000's Contact & Social Links
eetrigger = getent( "eetrigger", "targetname" );
eetrigger waittill ("trigger", player);
eetrigger delete;
player giveweapon( "tesla_gun_upgraded" );
i want this script how can i use it what must to do ?

 
Loading ...