Created
December 28, 2016 13:08
-
-
Save marcogravbrot/3f84a945f7f5c6342123a418ba371245 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() | |
{ | |
thread anti_gravity(); | |
} | |
#define ANTI_GRAV_DEFAULT 800 | |
#define ANTI_GRAV_LOW 500 | |
function anti_gravity() | |
{ | |
gravzones = GetEntArray("anti_gravity_zone", "targetname"); | |
foreach(k, zone in gravzones) | |
{ | |
zone anti_gravity_think(); | |
} | |
} | |
function anti_gravity_think() | |
{ | |
while(true) | |
{ | |
self waittill("trigger", player); | |
player SetPlayerGravity(ANTI_GRAV_LOW); | |
player AllowDoubleJump(true); | |
while(true) | |
{ | |
if(!player IsTouching(self)) | |
{ | |
player SetPlayerGravity(ANTI_GRAV_DEFAULT); | |
player AllowDoubleJump(false); | |
break; | |
} | |
WAIT_SERVER_FRAME; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment