Javascript-Expansion/scripts/has_permission.js
Frcsty 33b8f26ee3
Added tags.js, updated has_permission.js (#14)
* Updated documentation

* Create tags.js

* Update master_list.json
2020-03-10 12:23:56 -04:00

36 lines
957 B
JavaScript

/*
A simple placeholder which checks if the user has a permission
First we create our permission variables which will give a boolean output whether or not
the user has the specified permission
*/
var haspermission = "%player_has_permission_permission.test%";
/*
Here we create a function called hasPermission (can be named whatever you'd like)
which will do all the checks
*/
function hasPermission() {
/*
If the haspermission variable which we created above returns yes (true boolean)
the placeholder will return the bellow if statements value
*/
if (haspermission === "yes") {
return "&aYou have the Test permission!";
}
/*
If the haspermission variable doesn't return the above state (true boolean),
the user does not have the checked permission, so we return the bellow else statements value
*/
else {
return "&cYou don't have the Test permission!";
}
}
/*
Here we call the hasPermission function so it runs
*/
hasPermission();