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

Check if the player is jumping

broken avatar :(
Created 12 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
3,257 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Hi there.

How can I check in scripts if the player is jumping?
There are many different checks of button presses at the scripting references, but not for space, all I want to know is how I would check if the player is jumping.
Or maybe there are anything like,
Code Snippet
Plaintext
self waittill("jump");
If there is a waittill for that, it would work too.

Thanks in advance. :D
Last Edit: June 30, 2014, 11:28:51 am by Ege115
broken avatar :(
×
broken avatar :(
[UGX] Developer
Location: nlLimburg, Netherlands
Date Registered: 28 October 2013
Last active: 2 years ago
Posts
764
Respect
Forum Rank
The Decider
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
[UGX] Developer
×
Lukkie1998's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Mapper Has released one or more maps to the UGX-Mods community.
UGX Chat Moderator Has the ability to mute, kick, or ban chat members for being abusive or breaking the rules of the forum.
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
2015 Participant
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
There is (according to UGX Script Reference) a function called:
Code Snippet
Plaintext
if(player isOnGround());
If your player is jumping, you can say:
Code Snippet
Plaintext
if(player isOnGround() == false);
Check http://ugx-mods.com/script/#core.Player.isOnGround
Lukkie1998
Last Edit: June 30, 2014, 11:32:40 am by lukkie1998
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
There is (according to UGX Script Reference) a function called:
Code Snippet
Plaintext
if(player isOnGround());
If your player is jumping, you can say:
Code Snippet
Plaintext
if(player isOnGround() == false);
Check http://ugx-mods.com/script/#core.Player.isOnGround
Lukkie1998
Wow that was actually very creative, but I would need something like that the player can control. If I check if the player is not on the ground, in this case then I would like to have it controlled by if the player is jumping. (Pressing space)

It would be useful if there was some kind of a waittill the player is jumping.
But IF there was a button press check function for "space" then the IsOnGround() function would be really useful. :)
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Wow that was actually very creative, but I would need something like that the player can control. If I check if the player is not on the ground, in this case then I would like to have it controlled by if the player is jumping. (Pressing space)

It would be useful if there was some kind of a waittill the player is jumping.
But IF there was a button press check function for "space" then the IsOnGround() function would be really useful. :)
if( ButtonPressed("{[+whateverthebind]}") ) should work.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 2 years ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
if( ButtonPressed("{[+whateverthebind]}") ) should work.

I heard the function ButtonPressed only works for the host. Not sure if that's true.
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 7 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
I heard the function ButtonPressed only works for the host. Not sure if that's true.
well thats what the doc says. i think that it may look what that button is for the host. not that it just can be called on the host, maybe?
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I heard the function ButtonPressed only works for the host. Not sure if that's true.
It might or might not, have never properly tested it :c
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
buttonpressed() is host only, which is why our script ref says it is. Doesn't matter who you call it on or if you call it on anyone at all - it checks the host.

isOnGround() will not tell you when the player is jumping, it will only tell you when he is floating - not the most reliable check.

However, assuming none of your players are cheating, there should not be a way to get off the ground without jumping or falling, so I would say it will get the job done in this case. If your scripts take the players off the ground without them jumping, set a bool on the players so that your jump check knows why they are in the air and can ignore it as a jump.

If this does not work for you then you need to be more specific about the reason behind your need for this jump detection.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 2 years ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
buttonpressed() is host only, which is why our script ref says it is. Doesn't matter who you call it on or if you call it on anyone at all - it checks the host.

The last time I checked the script reference it wasn't stated that it's host only. Probably because that it was "automatically added."  :poker:
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
buttonpressed() is host only, which is why our script ref says it is. Doesn't matter who you call it on or if you call it on anyone at all - it checks the host.

isOnGround() will not tell you when the player is jumping, it will only tell you when he is floating - not the most reliable check.

However, assuming none of your players are cheating, there should not be a way to get off the ground without jumping or falling, so I would say it will get the job done in this case. If your scripts take the players off the ground without them jumping, set a bool on the players so that your jump check knows why they are in the air and can ignore it as a jump.

If this does not work for you then you need to be more specific about the reason behind your need for this jump detection.
What I am trying to do is to run a function if the player is jumping twice.

I know you can't jump twice, but I try to run a function that will run if the player is pressing "space" twice. So player press space, then the player will jump, then while the player is in the air after jumping, then it will check if the player is pressing space again, then it will start running a function.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
What I am trying to do is to run a function if the player is jumping twice.

I know you can't jump twice, but I try to run a function that will run if the player is pressing "space" twice. So player press space, then the player will jump, then while the player is in the air after jumping, then it will check if the player is pressing space again, then it will start running a function.
I don't think that is possible in a coop environment because there is no way to tell if they "double jump" since it 's a button press check. You could try the players[k] notifyoncommand("+jump"); that was suggested above, but I'd bet it's host only too. Never bothered trying.

 
Loading ...