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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - GNT123

I've already seen this being talked about. I'm very very new to all this and was wondering how I'd go about making this script open a door if anyone can help me this would mean a lot to me and others.   :poker:

Code Snippet
Plaintext
function init()
{
level.shootablesNeeded = 3;
level.shootablesCollected = 0;

level thread shootable_1();
level thread shootable_2();
        level thread shootable_3();
}


function shootable_1()
{
    trig_1 = GetEnt("shootable_trig_1", "targetname");
model_1 = GetEnt("shootable_model_1", "targetname");

trig_1 SetHintString("");
trig_1 SetCursorHint("HINT_NOICON");

while(1)
{
trig_1 waittill("trigger");

level.shootablesCollected++;

IPrintLn("Trigger 1 Shot"); // Not Needed

thread shootables_done();

break;
}

trig_1 Delete();
model_1 Delete();
}

function shootable_2()
{
trig_2 = GetEnt("shootable_trig_2", "targetname");
model_2 = GetEnt("shootable_model_2", "targetname");

trig_2 SetHintString("");
trig_2 SetCursorHint("HINT_NOICON");

while(1)
{
trig_2 waittill("trigger");

level.shootablesCollected++;

IPrintLn("Trigger 2 Shot"); // Not Needed

thread shootables_done();

break;
}

trig_2 Delete();
model_2 Delete();
}
function shootable_3()
{
    trig_3 = GetEnt("shootable_trig_3", "targetname");
model_3 = GetEnt("shootable_model_3", "targetname");

trig_3 SetHintString("");
trig_3 SetCursorHint("HINT_NOICON");

while(1)
{
trig_3 waittill("trigger");

level.shootablesCollected++;

IPrintLn("Trigger 1 Shot"); // Not Needed

thread shootables_done();

break;
}

trig_3 Delete();
model_3 Delete();
}



function shootables_done()
{
door_power = GetEnt("door_power", "targetname");
while(1)
{
self waittill(level.shootablesCollected >= level.shootablesNeeded);

if(level.shootablesCollected == level.shootablesNeeded)
{
             door_power MoveZ(-100, 5);

             wait 5;

             door_power Delete();

        break;
}
}
}
Haven't test this but it should work. Just do reckfullies tutoral at the top of the forum and just add one more script model with a targetname "shootable_model_3" and a trigger damage with the targetname "shootable_trig_3" then add your door make it a  script modle and add the targetname "door_power".  Finally, this should work but it will not say your entering the zone so if you want zombies to spawn in your power room you might have to have someone easle help you with that.

 
7 years ago
Do we have the assets for all these to be able to give them to the player?
7 years ago
Well you can store their current weapon(s) in a variable then give them a new one.

Once its over you can give them the weapons from the stored variable.

I'm not going to write a script for you but since you are making your own shooting range I would expect you at least know how to script.

function that gives the player there gun.


function gun(player)
{
   
    player DisableOffhandWeapons();
    player DisableWeaponCycling();
   

    player AllowLean( false );
    player AllowCrouch( false );
    player AllowSprint( false );
    player AllowProne( false );       
    player AllowMelee( false );
    player AllowJump( false );


    if ( player GetStance() == "prone, Crouch" )
    {
        player SetStance( "stand" );
    }

    primaries = player GetWeaponsListPrimaries();
   
    start_gun = player GetCurrentWeapon();
    start_ammo = player GetWeaponAmmoStock( start_gun );
    weapon = "pistol_burst";   // rk5 just because idk what the name of the argus is
    player GiveWeapon( weapon );
    player SwitchToWeapon( weapon );
   
    self waittill("done");

    player EnableOffhandWeapons();
    player EnableWeaponCycling();
    player GiveWeapon( start_gun );
    player SetWeaponAmmoStock( start_gun, start_ammo );
    player SwitchToWeapon( start_gun );
    player AllowLean( true );
    player AllowSprint( true );
    player AllowProne( true );       
    player AllowMelee( true );
    player AllowJump( true );
    return start_gun;
     
     wait .5;
     
   
}

If you can tell me what's wrong with that because everything else works beside it giving me the rk5/shootgun, and also if you tell me were to look for the names for guns that would be great because I have searched for them in the _zm_weapons.gsc  can't find them. Also what's the easiest way of not allowing a person to move because I couldn't find it in the _zm_utility.gsc just found how not to let them sprint, switch weapons ect. I hope that it's not something easy that I'm just overlooking, Thsnks.

Double Post Merge: October 21, 2016, 10:10:35 pm
nvm I got the gun list I guess it helps of you go the wiki, also found out how to give the gun as well I guess the only thing I have left for questions what the easies way to make it so players can't move forward back left right but sill spin in place?
7 years ago
So in my map I have like a shooing range EE so I was wondering can someone please help me with giving the player a argus shotgun while they shoot the target but then give them back their gun that they had before they started the shooting range. Thanks.
7 years ago
How do I make it so only a certain gun activates the shootable trigger and others don't? It would help me out a lot thanks!
8 years ago
Thanks if found my mistake. One last question how do I set up like a scriptflag so when I active the trigger that it enters me into the zone?
8 years ago
This moves the "door"

door1 = GetEnt("door1", "targetname");
door1 MoveTo((-16, 80, 9), 0.5, 0.05, 0.05);

or this rotates the door.

door1 = GetEnt("door1", "targetname");
door1 RotatePitch( -5, 0.26, 0.15, 0.1 );



use a script origin to get coordinates
**MoveTo((coordinate, coordinate, coordinate), 0.5, 0.05, 0.05);
0.5=The time to move the entity in seconds
0.05=The time spent accelerating
0.05=The time spent decelerating

RotatePitch( -5, 0.26, 0.15, 0.1 );
-5=The new pitch angle in degrees
0.26=The time to rotate in seconds
0.15=The time spent accelerating in seconds
0.1=The time spent decelerating in seconds

info from  - http://www.zeroy.com/Script/

idk that didn't seem to work and idk why
8 years ago
On my map I have challenges that people do and once they complete them I want doors to open, but I don't know how to tell a script to do that. So any help would be much appreciated. Thanks!
8 years ago
What I mean't was if it wasn't possible with a single function just do the give_perk function for every perk at once.

Ill look right now and see if they made a function for giving them all at once.

EDIT:
It doesn't look like tryarch made a function for giving all perks.

You can just give the player every perk at the same time and it will essentially be the exact same.

If you are still having trouble with giving perks, make sure this is included in the script:
Code Snippet
Plaintext
#insert scripts\zm\_zm_perks.gsh;

and for the perkname just look inside _zm_perks.gsh for all the names.(root/share/raw/scripts/zm/_zm_perks.gsh)

 player zm_perks::give_perk("specialty_electriccherry", true);

^(what my thing looks like) Idk I cant get it to work I have tried true, and false different perks I just don't know what I'm doing wrong

Double Post Merge: October 12, 2016, 03:32:15 am
nvm I saw that one guy just post it on the shootable trigger topic
8 years ago
Were would I look to tell it to give me all perks?
8 years ago
1-17 Multiplier reword camos
1=jungle tech
2=ash
3=flactarn
4=heat stroke
5=snow job   
6=dante
7=integer
8=6 speed
9=policia
10=ardent
11=burnt
12=bliuss
13battle
14=chameeon
15=gold
16=diamond
17=dark matter
18=?
19=stealth
20=?
21=?
zombie unlockable camos 22-26
22=contagious
23=fear
24=wmd
26=red hex
27=ritual
28=black ops 3
29=cyborg
30=?
31=?
32=?

All question marks were black marked camos that I didn't know name to.
8 years ago
It works now thanks.
8 years ago
I think this was a mistake when HitmanVere edited it, ill fix it since function wasn't supposed to be there in the first place.

Re do the part where the script is made, at the top where the functions are threaded they are supposed to be
Code Snippet
Plaintext
thread shootable_1();
thread shootable_2();

Just updated OP.
I can get in the game but after I shoot the model my game get connection interrupted.
8 years ago
Thanks for fixing all the problems, should have tested it sooner since I wrote this from memory cause I couldn't get on steam at the time.

**** 1 script error(s):
 "function_shootable_1" with 0 parameters in "scripts/custom/shootable.gsc" at line 7 ****
**** Unresolved external "function_shootable_1" with 0 parameters in "scripts/custom/shootable.gsc" ****

Idk if you changed the script but I'm getting this new error now since I recopied and pasted it.
8 years ago
got this error when compiled the map:

^1
^1^
^1ERR(6E) scripts/custom/shootable.gsc (15,0)  : Compiler Internal Error :  Uninitialized local variable 'targetname'

Any thoughts on how to fix?
8 years ago
Loading ...