| Blockland Forums > Modification Help |
| How do I make a weapon so only admins can use it? |
| (1/1) |
| Lando The Climber:
Well, I need to make it so when you equip the weapon it checks if you are an admin, I tried --- Code: ---if(%client.isAdmin || %client.isSuperAdmin) { blahblahstuffhere } else { blahblahblah warning that you cant use it }; --- End code --- it didn't work, could someone help me please? |
| jes00:
Try --- Code: ---if(%client.isAdmin || (%client.isSuperAdmin)) { //code here } else { //code here } //do not put the ; unless it is the closing bracket of a package. --- End code --- |
| Lando The Climber:
It doesn't load, I checked the error report in the console and it put the ## things around the % sign in %client.isAdmin |
| Swollow:
--- Code: ---function WeaponImage::OnMount(%this, %obj) { %client = %obj.client; if(%client.isSuperAdmin || %client.isAdmin) { Parent::OnMount(%this, %obj); } else { %client.centerPrint('5', '<color:ff0000>This tool is for admins only.', ''); } } --- End code --- |
| Lando The Climber:
--- Quote from: swollow on December 30, 2011, 06:38:24 PM --- --- End quote --- Worked, thanks a bunch. |
| Navigation |
| Message Index |