Ok, I obviously made a mistake, but I don't know where did I go wrong. I just tried to add the "Fall Damage" and "Wall Jumping" snippets. Argh, I don't even know how to modify two scripts.
Code:
int jumpKey = 0;
int fallTimer = 0;
const double maxFallTime = 4;
void onMain() {
jjPLAYER@ p = jjLocalPlayers[0];
p.ammo[2] = 3;
if (p.keyJump == true) {
jumpKey = jumpKey+1;
} else {
jumpKey = 0;
}
if (jjMaskedPixel(p.xPos + (p.direction * 13), p.yPos) && p.keyJump == true && jumpKey < 3) {
p.ySpeed = -10;
p.direction = p.direction * (-1);
p.xSpeed = p.direction * 5;
// && p.ySpeed < 0
}
if (jjMaskedPixel(p.xPos + 13, p.yPos) && p.ySpeed > 0 && p.keyRight == true) {
p.ySpeed = 1;
p.alreadyDoubleJumped = false;
}
if (jjMaskedPixel(p.xPos - 13, p.yPos) && p.ySpeed > 0 && p.keyLeft == true) {
p.ySpeed = 1;
p.alreadyDoubleJumped = false;
}
int fallTimer = 0;
const double maxFallTime = 4;
void onMain() {
if (!jjMaskedPixel(p.xPos, p.yPos + 32) && p.ySpeed > 0) {
fallTimer++;
} else if (jjMaskedPixel(p.xPos, p.yPos + 32)) {
int repeats = (fallTimer / 70) / maxFallTime;
if (fallTimer >= maxFallTime) {
for (int i = 0; i < (fallTimer / 70) / maxFallTime; i++) {
p.health = p.health - 1;
if (p.health < 0) p.health = 0;
}
}
fallTimer = 0;
}
if (p.health == 0) {
fallTimer = 0;
}
}
AngelScript reminds me a little bit about LUA, but LUA was slightly easier, or at least on Roblox. Don't judge the Roblox players, it takes a lot of time to do a decent game and you need to know both modeling and programming...
__________________

"Floppy ears and a big butt?" - Slaz
|