How to create a levitation script?

The idea is, holding the jump button suspends falling. I don’t want to disallow movement entirely, I just want to suspend movement on the Y axis so the character cannot fall to the ground while the jump button is held, and I need some help.

It’s supposed to disallow holding the jump button, after it’s been held for some time, which it does, but im having issues keeping the character from falling.

My script page is a bit of a mess and I want the jump to do multiple different things, so I think posting what I have will just complicate matters. Can someone help me out?

Hey, i think i made kinda what you want : 5A0SB
To explain it a bit, when you walk (with jump key not pressed), it define a variable Y with is the Y-position of the player + an amout that you can define (it will set the max height you can have)
Then when youjump, it just push the player up until it reach the Y value. If the player fall under Y value, the push restart. It kinda make you fly at the Y value choose.

Tip : one the impulse command, the speed line determine how hight the push is, higher the number higher the jump

It’s a bit wobbly, honestly. However, I’d actually done this before, but i didn’t keep it because getting pulled over a ledge by roadhog didn’t help you to get back up, and at the time, the idea was to keep you from falling to your death.

It was actually meant for sigma, so that he would have some defense against being pulled or pushed into a pit.

I just want it to be smooth so it’s not bad on the eyes. But thanks.

Just to know, do you want him not to die when he jump while into the pit ? or just not die even if he didn’t press jump ?

And to get rid of the wobbly effect just put 0.001 instead of 2 at the end of the impulse effect. If you wanna make the dude goes up it will take ages, but it stop him from falling and cancel the wobbly effect (the wobbly effect is proportional as the number). Also change rule 1 and add -1 to Y so it really make it stop only if it fall

Edit : try this and tell me EY46P

After editing for hours and hours, it’s just not working properly.

I don’t want it to be abused, So I’m trying to disable the jump button after a period of time has passed. But nothing i try disables the button. I want to re-enable it once landing on the ground.

And while sigma is levitating, i dont want the player to be able to start levitating again until after he has landed, so if the button is released, you can’t press it again before touching the ground.

the scripts marked, “this” are related to the levitation. There’s another one, towards the end marked “jump” that’s also related.

Code: 5SM38

Well your code is a mess and i don’t want to learn it ^^ but i think i made what you want : V6GKH

Basicly it’s the same, except the variable S track if the player as already use his levitating jump (so he can’t use it twice on air, and reset when he land on ground) and T variable is for the time it works before falling again ( 50 is roughly equal to 1s, 100 = 2s, etc…), it reset also when he land somwhere.

So try to put it somewhere in your code, and not create conflic with variable ^^ (they are all player’s variable)

Sorry, I’ve been really busy these past few days, and haven’t had any time to play overwatch, or anything else at all. This seems to be it, the only issue is that it doesn’t reliably reset when you’re on the ground. However that, i’m sure i can fix. Thanks.

one of my fav hovers

rule(“Hover (start)”)
{
event
{
Ongoing - Each Player;
All;
All;
}

conditions
{
	Is Button Held(Event Player, Jump) == True;
}

actions
{
	Start Accelerating(Event Player, Up, Subtract(25, Altitude Of(Event Player)), 9.800, To World, Direction Rate and Max Speed);
}

}

rule(“Hover (end)”)
{
event
{
Ongoing - Each Player;
All;
All;
}

conditions
{
	Is Button Held(Event Player, Jump) == False;
}

actions
{
	Stop Accelerating(Event Player);
}

}

Ok i’ve figured out why it happend and found how to fix it :
On rule 2, just add an action who skip the “Set S variable to 0” if the player is on ground, it look like this : Skip If(Compare(Is On Ground(Event Player),==,True),1)
(or like in this code ^^ : 7CKZH)

Anyway, it was happening if you hold the jump button after doing a normal jump, when you relase the button, the variable S was set 0 even if you were on ground