Use PHP tags instead of QUOTE tags.
It's a logical mess.
Here.. have a scripting puzzle.
Here's the bare-bones for a weapon you turn on and off, and one of the ones you can check for keys being held down.
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
// Check if weapon is on
if (this.on) {
// Notify player of change
player.chat = "Weapon is now OFF!";
// Set on flag to false/off
this.on = false;
} else {
// Notify player of change
player.chat = "Weapon is now ON!";
// Set on flag to true/on
this.on = true;
// Start Looping
setTimer(0.05);
}
}
// When the time runs out in setTimer, it causes a timeout.
// Which triggers the onTimeout function/event.
function onTimeout() {
// Check for Keys being Held Down
if (keydown(6)) {
player.chat = "IM PRESSING GRAB NOW LOL";
}
else if (keydown(5)) {
player.chat = "IM PRESSING ATTACK NOW LMAO";
}
// Continue Looping / Timing out while On
if (this.on) setTimer(0.05);
}
You can control the z-axis by calling these functions:
PHP Code:
//#CLIENTSIDE
function raise_z() {
// Raise Z
player.z += 0.05;
// Check if over Maximum Height
if (player.z > 10) player.z = 10;
}
function lower_z() {
// Lower Z
player.z -= 0.05;
// Check if under Minimum Height
if (player.z < 0) player.z = 0;
}
function reset_z() {
// Resets Player Z value
player.z = 0;
}
Make a Jetpack out of it.