Post: Forcing a jump
11-03-2015, 10:26 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); Is there a way of forcing a player to jump? I want to create something like a Scuf jump script where the player automatically jumps (and keeps doing so) when aiming down the sights. Tustin

    enableScufJumping()
{
self endon("disconnect");

while(true)
{
if(self adsButtonPressed())
{
self forceJump();

wait 0.1;
}
}
}

forceJump()
{
// ?
}

I for example found the function
    void forcegrenadethrow()

which appears to force a grenade throw but it's only for grenades. No such function exists for jumping or other actions how it seems. :(
(adsbygoogle = window.adsbygoogle || []).push({});
11-04-2015, 06:45 AM #2
iiiCenTurY
Gym leader
Originally posted by BullyWiiPlaza View Post
Is there a way of forcing a player to jump? I want to create something like a Scuf jump script where the player automatically jumps (and keeps doing so) when aiming down the sights. Tustin

    enableScufJumping()
{
self endon("disconnect");

while(true)
{
if(self adsButtonPressed())
{
self forceJump();

wait 0.1;
}
}
}

forceJump()
{
// ?
}

I for example found the function
    void forcegrenadethrow()

which appears to force a grenade throw but it's only for grenades. No such function exists for jumping or other actions how it seems. :(


I dont Think There is something like this but you could use setorigin:
forcejump()
{
self setorigin(self.origin + (0,0,50);
}

Edit: i think setvelocity works better than setorigin.

The following user thanked iiiCenTurY for this useful post:

BullyWiiPlaza
11-04-2015, 10:50 AM #3
BullyWiiPlaza
Climbing up the ladder
Originally posted by iiiCenTurY View Post
I dont Think There is something like this but you could use setorigin:
forcejump()
{
self setorigin(self.origin + (0,0,50);
}

Edit: i think setvelocity works better than setorigin.

Alright, at least something. I knew
    setOrigin()
but since you wrote it now I might use it Smile
11-04-2015, 10:54 AM #4
iiiCenTurY
Gym leader
Originally posted by BullyWiiPlaza View Post
Alright, at least something. I knew
    setOrigin()
but since you wrote it now I might use it Smile


Yh but i think setvelocity will work better.
for(;Winky Winky
{
If(self onground())
{
Wait 0.1;
If(self adsbuttonpressed())
{
Self setvelocity(self getvelocity() + (0,0,200));
}
Wait 0.05;
}
}
Just play with a bit and you will find out.
11-04-2015, 11:48 AM #5
BullyWiiPlaza
Climbing up the ladder
Yeah, I was going to use
    isOnGround()
since otherwise it would let players moonjump which shouldn't be possible.
11-06-2015, 02:55 PM #6
BullyWiiPlaza
Climbing up the ladder
Well, your code didn't quite work. It pushed me to the side and not upwards at all. After the match ended, it crashed with "Connection interrupted".

    enableScufJumping()
{
self endon("disconnect");

while(true)
{
if(self isOnGround())
{
wait 0.1;

if(self adsButtonPressed())
{
self setVelocity(self getVelocity() + (0, 0, 200));
}

wait 0.05;
}
}
}

The following user thanked BullyWiiPlaza for this useful post:

itsSorrow
11-06-2015, 11:34 PM #7
itsSorrow
In my man cave
Originally posted by BullyWiiPlaza View Post
Well, your code didn't quite work. It pushed me to the side and not upwards at all. After the match ended, it crashed with "Connection interrupted".

    enableScufJumping()
{
self endon("disconnect");

while(true)
{
if(self isOnGround())
{
wait 0.1;

if(self adsButtonPressed())
{
self setVelocity(self getVelocity() + (0, 0, 200));
}

wait 0.05;
}
}
}


I remember doing this for someone a while ago and used setvelocity aswell :P

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo