| Blockland Forums > Modification Help |
| Need help fixing Iban's Lockpick. |
| << < (4/4) |
| Iban:
The lockpick is a stupid idea because no matter what course of action you use there is some gimmicky way to stop it. Code: %door.contentStart(...); Events: onContentStarted -> barrier -> setColliding [true] onContentStopped -> barrier -> setColliding [false] onContentStuck -> StuckPlayers -> InstantRespawn That way, even if you do force the door open, it's still going to keep the intruder out. The only way around this is to make rules saying "Do not safeguard your doors," which is absolutely outrageous. If your server can be griefed like that, you're not doing a very good job at making a server. |
| Derroith:
--- Quote from: Nexus on April 18, 2011, 04:55:07 PM ---The point is, if there is no event on the door, why should it open for any reason? The way mine would work, I think, is if any events that would be triggered by the door opening would also be triggered. That way, the lockpick could also be used for windows and buttons and odther jvs things. --- End quote --- Yours doesn't work, just tested. --- Quote from: Iban on April 18, 2011, 05:19:57 PM ---The lockpick is a stupid idea because no matter what course of action you use there is some gimmicky way to stop it. Code: %door.contentStart(...); Events: onContentStarted -> barrier -> setColliding [true] onContentStopped -> barrier -> setColliding [false] onContentStuck -> StuckPlayers -> InstantRespawn That way, even if you do force the door open, it's still going to keep the intruder out. The only way around this is to make rules saying "Do not safeguard your doors," which is absolutely outrageous. If your server can be griefed like that, you're not doing a very good job at making a server. --- End quote --- Agh, I don't get you, what do you mean 'safegaurd' and all that? |
| Bloxxed:
Bump. I still need some help, but with a different problem now. I've found a work around, by fakekilling the block, the only problem is that. It fakekills the any brick, but not a JVS door. It gives demerits if you hit a brick, but not a door. --- Code: ---function CityRPGPicklockImage::onHitObject(%this, %obj, %slot, %col, %pos, %normal) { %client = %obj.client; if(%col.getType() & $TypeMasks::FxBrickObjectType) { if(getrandom(0,3) == 2) { if (!isObject(%col.shape)) { %col.fakeKillBrick(1, 3); commandToClient(%client, 'centerPrint', "\c6You have commited a crime. [\c3Breaking and Entering\c6]", 3); CityRPG_AddDemerits(%client.bl_id, $CityRPG::demerits::breakingAndEntering); return; } else { commandToclient(%client, 'centerprint', "\c6Picking Lock...", 3); } } } else if(%col.getType() & $TypeMasks::VehicleObjectType) { if(%col.locked) { %col.locked = false; CityRPG_AddDemerits(%obj.client.bl_id, $CityRPG::demerits::grandTheftAuto); commandToClient(%client, 'centerPrint', "\c6You have committed a crime. [\c3Grand Theft Auto\c6]", 5); } } parent::onHitObject(%this, %obj, %slot, %col, %pos, %normal); } --- End code --- Thanks if you can help. |
| otto-san:
Well, you COULD loop through ContentBricksSO and see if %col is in it, and if it is fakekill it and if not, don't. Something like this, maybe. --- Code: ---for(%i = 0; %i < ContentBricksSO.bricks;%i++) { if(%col == ContentBricksSO.brick[%i]) { %yes = 1; break; } } if(%yes) %col.fakeKillbrick(1, 3); --- End code --- adapt to your code. |
| Pah1023:
--- Quote from: otto-san on April 22, 2011, 01:17:28 AM --- --- Code: ---for(%i = 0; %i < ContentBricksSO.bricks;%i++) { if(%col == ContentBricksSO.brick[%i]) %yes = 1; break; } if(%yes) %col.fakeKillbrick(1, 3); --- End code --- --- End quote --- This wont work, torque will read it as if(%col == ContentBrickSO.brick[%I]) %yes = 1; break; And will break on the first brick.You need to add brackets to it. |
| Navigation |
| Message Index |
| Previous page |