Jump to content

Admin Build Prevention


AgentGamerPro

Recommended Posts

Admin Build Prevention

command /BuildMode:
	permission: SW.Build
	permission message: &cInsufficent Permission
	trigger:
		if {BuildMode.%player%} is not set:
			set {BuildMode.%player%} to true
			send "&aYou have enabled build mode! You can now interact with your surroundings. &2Type /BuildMode again to disable!" to player
		else if {BuildMode.%player%} is false:
			set {BuildMode.%player%} to true
			send "&aYou have enabled build mode! You can now interact with your surroundings. &2Type /BuildMode again to disable!" to player
		else if {BuildMode.%player%} is true:
			set {BuildMode.%player%} to false
			send "&cYou have disabled Build Mode! You can no longer build or break blocks. &4Type /BuildMode again to enable!" to player

on break:
	if {BuildMode.%player%} is false:
		if player has permission "SW.Build":
			cancel event
			send "&cYou cannot break anything! Type /BuildMode to enable breaking/placing blocks!" to player

on place:
	if {BuildMode.%player%} is false:
		if player has permission "SW.Build":
			cancel event
			send "&cYou cannot place anything! Type /BuildMode to enable breaking/placing blocks!" to player

Ever accidently break stuff while playing a gamemode? Type /Buildmode to enable/disable building for you and you only!

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Lifestealed | Minecraft Servers
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - Present

 

Link to comment
Share on other sites

Just a skript tip:

try to use list variables {variable::%input%}
as they are far better for storage
also try to use uuid instead of player something like: {player::%player's uuid%::something}
You can also make your code more organized by doing negative checks, like checking the opposite of what you want first, then stopping there so you either can choose not to do a else or you can.
example:
 

on join:
	if player has not played before:
		send "Welcome to the server! Thanks for joining!"
		stop
	send "Welcome back to the server"

instead of 

on join:
	if player has played before:
		send "Welcome back to the server!"
	else if player has not played before: #or just else
		send "Welcome to the server! Thanks for joining!"

This is apparent in the later part of the skript with the place and break event:
 

on place:
	if {BuildMode.%player%} is not false:
		stop
	if player does not have permission "SW.Build":
		stop
	cancel event
	send "&cYou cannot place anything! Type /buildmode to enable breaking/placing blocks!"
	stop

 

Edited by Bluberriess

 


[PATRON] Echology

image.png.25b196fc30999f9133398315a98c2b11.png

Sponk = Weeb


 

Link to comment
Share on other sites

Good work 😄 Keep it up 😄

 

  • Like 2
image.png.6b83388bece6fb7d874e120f33c8dd96.png


IGN ➣ Pickey ( Soon ) 
Joined MineHut ➣ January 7th 2019
Joined Forums ➣ January 11th 2021
 
Admin on NotedGens
Manager on NotedGens
Developer on Cropied
Developer on Gennow (Genable)

==========================================
Best Job: Badlion ( Client Moderator [ Failed Trial / Demoted] )
Retired From: InvadedLands ( Moderator )
Retired From:  MineTime ( Sr.Moderator )
Retired From: Hero Mines ( Helper )
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...