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.

Topics - battleduck

Code Snippet
Plaintext
function switch_2()
{
radius_trig = GetEnt("radius_trig2", "targetname");
        switch_trig = GetEnt("switch_trig2", "targetname");
switch_trig SetHintString("Press and hold &&1 to connect Auxillary Power.");
switch_trig SetCursorHint("HINT_NOICON");
timer = 10;

radius_trig waittill("trigger", player);
switch_trig waittill("trigger", player);
if (timer > 0)
{
wait .5;
switch_trig setHintString("Connection in progress...");
wait timer;
}

switch_trig setHintString("Connection Re-established!");

level.switchesCompleted++;

        DO OTHER STUFF....
}


I have the above code... how would I check that the player is still within the trigger radius whilst the 10sec timer runs down.

I want the player to have to stay within the radius for the duration of the timer, and if they leave the radius, then the timer resets to 10.

Any help appreciated. Cheers
7 years ago
Hi, i'm trying to work out how to script a trigger_damage that only triggers when damaged by a particular weapon (eg. raygun or gravity spikes)
Is there a way to check for what weapon inflicted the damage on the trigger, or do I need to do something like wait for the trigger to trigger, and then check which weapon the player had at the time?
7 years ago
Loading ...