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.
Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Has released one or more maps to the UGX-Mods community.
Has the ability to mute, kick, or ban chat members for being abusive or breaking the rules of the forum.
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.
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.
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.
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.
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."
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.
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.