Quote:
|
Originally Posted by Stefan
Sorry for deleting some posts but I don't want moderators *****ing at people who are asking for help. I hope someone can help with a link to a code snippet (on graal.net, we also plan a code snippet section on wiki.graal.net) or give hints on how to do a haste script.
|
I agree with you 100%. It's not good business to ***** at paying customers who are just looking for help.
And for your haste script, do you mean running? If so you can play around with this:
PHP Code:
//#CLIENTSIDE
function onCreated() {
this.speed = 0.2;
}
function onKeyPressed(code,character) {
this.pressed = !this.pressed;
if (this.pressed) {
if (character == "h") {
setTimer(0.05);
player.chat = "Hasting!";
}
}
elseif (character == "h") {
setTimer(0);
player.chat = "Walking!";
}
}
function onTimeout() {
temp.ar = {player.x+1.5+vecx(player.dir)*1.1,
player.y+2+vecy(player.dir)*1.1
};
if (onwall(temp.ar[0],temp.ar[1])) {
setTimer(0.05);
}
if (!(onwall(temp.ar[0],temp.ar[1]))) {
if (keydown(0)) playery-=this.speed;
if (keydown(1)) playerx-=this.speed;
if (keydown(2)) playery+=this.speed;
if (keydown(3)) playerx+=this.speed;
setTimer(0.05);
}
}
It might not be the best, but it serves its purpose. It's a bit buggy so you'll have to work with it. It is activated by pressing "h", and deactivated by pressing "h" once again. I threw this together in like 5 minutes. So don't hate my skill. Problem with this script is, it's not checking around the player for a wall, so you'll have to play with it to make it do that.