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

Console comands into triggers value - possible?

broken avatar :(
Created 7 years ago
by Minepro14
0 Members and 1 Guest are viewing this topic.
5,056 views
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 21 September 2014
Last active: 7 years ago
Posts
28
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Minepro14's Groups
Minepro14's Contact & Social Links
hi

i would ask if there a way to put a console comand like "/timescale 0.5" into a value of a trigger, somethink like this
"Press and hold F to change the timescale to 0.5"
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
hi

i would ask if there a way to put a console comand like "/timescale 0.5" into a value of a trigger, somethink like this
"Press and hold F to change the timescale to 0.5"

Use the trigger like normal then once the trigger is activated use this:
Code Snippet
Plaintext
ModVar( "timescale", 0.5 );

Haven't actually used this but it seems its something people use for their anti-cheat to disable cheats like god by setting them to 0.
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 21 September 2014
Last active: 7 years ago
Posts
28
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Minepro14's Groups
Minepro14's Contact & Social Links
Use the trigger like normal then once the trigger is activated use this:
Code Snippet
Plaintext
ModVar( "timescale", 0.5 );

Haven't actually used this but it seems its something people use for their anti-cheat to disable cheats like god by setting them to 0.

and where in radiant i have to put it?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
and where in radiant i have to put it?

You won't be able to do anything special inside radiant. The way all triggers work is they are included inside scripts.

Here is an example:
Code Snippet
Plaintext
function init() // Initialization variable, call this in your mapname.gsc to start the script.
{
// Do whatever you would need to do here, not required for this.
thread GetTrigger(); // Calls the function while threading it so multiple functions can be executed at the same time.
}

function GetTrigger() // Function where all code for what you are currently doing is called.
{
trigger = GetEnt("triggertargetname", "targetname") // Replace "triggertargetname" with whatever you put in the targetname kvp in radiant.

// You would want a while loop here if you want the trigger to be able to be activated more than once.

trigger waittill("trigger", player); // Waits for the trigger to be activated, player isn't needed but is useful.
ModVar("timescale", 0.5); // Sets the timescale to 0.5
}
Last Edit: November 16, 2016, 08:06:49 pm by reckfullies
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 21 September 2014
Last active: 7 years ago
Posts
28
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Minepro14's Groups
Minepro14's Contact & Social Links
You won't be able to do anything special inside radiant. The way all triggers work is they are included inside scripts.

Here is an example:
Code Snippet
Plaintext
function init() // Initialization variable, call this in your mapname.gsc to start the script.
{
// Do whatever you would need to do here, not required for this.
thread GetTrigger(); // Calls the function while threading it so multiple functions can be executed at the same time.
}

function GetTrigger() // Function where all code for what you are currently doing is called.
{
trigger = GetEnt("triggertargetname", "targetname") // Replace "triggertargetname" with whatever you put in the targetname kvp in radiant.

// You would want a while loop here if you want the trigger to be able to be activated more than once.

trigger waittill("trigger", player); // Waits for the trigger to be activated, player isn't needed but is useful.
ModVar("timescale", 0.5); // Sets the timescale to 0.5
}

i get this error

Code Snippet
Plaintext
^1 trigger waittill
^1----------------^
^1ERR(0) scripts/zm/zm_les_planes.gsc (339,17) in "gettrigger()" : syntax error, unexpected TOKEN_WAITTILL, expecting TOKEN_LEFT_PAREN : trigger waittill
broken avatar :(
×
broken avatar :(
Location: nzChristchurch
Date Registered: 8 June 2014
Last active: 6 years ago
Posts
77
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Can I do this?
Signature
×
IDontEvenKnow's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
You need the () at the end of the waittill

Code Snippet
Plaintext
waittill()

Is what you really need.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
i get this error

Code Snippet
Plaintext
^1 trigger waittill
^1----------------^
^1ERR(0) scripts/zm/zm_les_planes.gsc (339,17) in "gettrigger()" : syntax error, unexpected TOKEN_WAITTILL, expecting TOKEN_LEFT_PAREN : trigger waittill

This was a mistake on my part, I forgot to add a semicolon at the end of a line.

Change:
Code Snippet
Plaintext
trigger = GetEnt("triggertargetname", "targetname")
to:
Code Snippet
Plaintext
trigger = GetEnt("triggertargetname", "targetname");
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 21 September 2014
Last active: 7 years ago
Posts
28
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Minepro14's Groups
Minepro14's Contact & Social Links
now its says me "Not Available"
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
now its says me "Not Available"

When it says "Not Available" on the trigger then that means that the KVPs doesnt match in the script and in radiant.

Make sure your trigger has a targetname that matches what you put in the script.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
now its says me "Not Available"

Another reason it might say this is if you initialized another custom script before this and didn't thread it so this script never got initialized.

 
Loading ...