| Blockland Forums > Modification Help |
| Different Slots for ShootOnClick |
| (1/1) |
| Deathwishez:
ShootOnClick uses slot 0 (Activate/Use/Fire) as it's firing trigger. Well, what if I wanted to use the jump button instead? I know it's Slot 2. So you'd think to change this: --- Code: ---package shootonClick_Pack { function armor::onTrigger(%db,%obj,%slot,%val) { if(%obj.getClassName()$="Player") { if(%slot==0) { if(%val) { if($Sim::Time<%obj.client.SOC_LastFireTime) { return; } } %obj.SOC_Shoot(%slot,%val); } } return Parent::onTrigger(%db,%obj,%slot,%val); } }; ActivatePackage(shootonClick_Pack); --- End code --- To this: --- Code: ---package shootonClick_Pack { function armor::onTrigger(%db,%obj,%slot,%val) { if(%obj.getClassName()$="Player") { if(%slot==2) { if(%val) { if($Sim::Time<%obj.client.SOC_LastFireTime) { return; } } %obj.SOC_Shoot(%slot,%val); } } return Parent::onTrigger(%db,%obj,%slot,%val); } }; ActivatePackage(shootonClick_Pack); --- End code --- Right? Well I did exactly that, and it doesn't work. If I change it back, it works fine, but with the old trigger. Am I missing another variable or something? |
| Deathwishez:
Figured it out. Apparently slots 2 and 3 don't work if you're mounted. Is there a way around this? vehicle::onTrigger will only substitute slot 2. |
| Greek2me:
Wouldn't you have to use vehicle::onTrigger? vehicle:: in vehicle observer:: dead, not respawned armor:: has player |
| Deathwishez:
--- Quote from: Greek2me on February 01, 2011, 08:58:45 PM ---Wouldn't you have to use vehicle::onTrigger? --- End quote --- --- Quote from: Deathwishez on February 01, 2011, 01:12:59 PM ---vehicle::onTrigger will only substitute slot 2. --- End quote --- I need a third trigger. |
| Navigation |
| Message Index |