Hello I was wondering if anyone knew how to set a permission on an else statement, My coding is below. Thank you!
? I'm not sure what you mean? Do you mean - Code (Text): if (p.hasPermission("PERM)) { //DO SOMETHING } else { //IF THEY DON'T HAVE IT } Please explain more
Yes if they don't have the perm it will give an error message and if they do they can do /fly on or off
Code (Text): // player does /fly if(player.hasPermission("fly.use")) { // do fly stuff } else { // no permission } }
@TpittGamez okay so try this, (or what @Cewlt said) Code (Text): if (player.hasPermission("fly.use)) { //Do the fly stuff } else { p.sendMessage("You do not have permission to do this"); }
Also how would I keep it so I don't need to do /fly on and /fly off and just need to do /fly (sorry I am kind of new to the /fly command coding)
Sorry, but you dont seem to understand anything. You should at least know how coding generally works. We gave you enough answers and you should know how to implement it.
I am just new to else statements I can do the coding for it I just don't know where to put the permission in. All I ned to know is where to put the permission statement in: Code (Text): if (!sender.hasPermission("fly.use")) { and where it would go in the coding, because if I put it under Code (Text): if (cmd.getName().equalsIgnoreCase("fly")) I get an error
New to else statements...................................................................................................................... I give up