Thread: Gravity Script.
View Single Post
  #6  
Old 06-27-2007, 08:47 AM
TheJames TheJames is offline
Atrius Manager
TheJames's Avatar
Join Date: Dec 2004
Posts: 581
TheJames can only hope to improve
Era's gravity.

Quote:
#CLIENTSIDE
if (created) {
this.gravspeed = 0.45; //Fall Speed
this.jumpheight = 1.5; //Jump height to reach
this.jumpspeed = 0.4; //Raise Speed in jump
this.jumpdelay = 0.6; //Jump interval (S)
}
if (playerenters || timeout) {
if (!onwall(playerx+0.5,playery+3+this.gravspeed) && !onwall(playerx+1.5,playery+3+this.gravspeed)) playery+=this.gravspeed;
else {
for (i=10;i>0;i-=1 {
if (!onwall(playerx+0.5,playery+3+((this.gravspeed/10)*i)) && !onwall(playerx+1.5,playery+3+((this.gravspeed/10)*i))) {
playery+=(this.gravspeed/10)*i;
break;
}
}
}
if (keydown(6) && this.jump==false && playerz==0 && this.jumptick==0) {
this.jump=true;
for (this.i=0;this.i<=this.jumpheight;this.i+=this.jum pspeed {
playerz+=this.jumpspeed;
setplayerprop #c,Y: #v(this.i);
sleep 0.05;
}
this.jump=false;
this.jumptick=this.jumpdelay;
}
if (playerz>0) playerz-=this.gravspeed;
else playerz=0;
if (this.jumptick>0) this.jumptick-=0.05;
timeout=0.05;
}
Era's gravity script. Enjoy! The 's = ; ) put together.
__________________
Contact me on Skype: "skype.sam.lorenz"

James,
Manager of Atrius
Reply With Quote