Quote:
Originally Posted by Fysez
CBK,
I think i've listed quite clearly now that the script I listed was a test,
Not the actual thing to disable since it doesn't even work anyways.
All I need is how to fix the script I have listed. From there, I can work my own way towards disabling swords.
Get it not?{o}.{o}
|
No, it wasn't clear what you were saying:
Quote:
Originally Posted by Fysez
Using that, I tried it as a test run under weapons. But it doesn't seem to work?:
|
We can't guess what you're trying to say. The code isn't working for a few reasons:
- You don't need an "if (weaponfired)" inside an onWeaponFired event; the former is a GS1 remnant that should never be used.
- setani requires two parameters, e.g. setAni("swim", null);
- Make sure it's clientside if it's not already.
Quote:
Originally Posted by Fysez
The problem is, Now I can't use my inventory (Q) and I can't use items (D)
Would you know how to fix this? I've been looking into it but can't seem to figure it out.
|
For firing weapons, you need to add something like this somewhere, clientside:
PHP Code:
function GraalControl.onKeyDown(temp.code, temp.key) {
if (temp.key == "d" && ! this.keyD) {
player.weapon.trigger("weaponFired"); // v6 only, add another parameter to support v5
this.keyD = true;
}
}
function GraalControl.onKeyUp(temp.code, temp.key) {
if (temp.key == "d") {
this.keyD = false;
}
}
edit: use the code Jer posted; his is preferable since it allows players to set their own keys
Put that in some system weapon that all players have.
To enable Q (not positive if it works when weapons are disabled—test it), don't remove it from "allfeatures" in your enablefeatures. See
here.