Jump to content

Advanced Maintenance Skript


pryduLiveTTV

Recommended Posts

#Please do not change this Skript unless you are experienced with the language.
#This skript was made by HealthGrief.
#https://forums.minehut.com/profile/1064211-healthgrief/

options:
    p: &c&lMAINTENANCE
    a: &8»

command /maintenance [<text>]:
	permission: maintenance.*
	permission message: &c&lMAINTENANCE &8» &cYou don't have permission to do this!
	cooldown: 2.5 seconds
	cooldown message: &c&lMAINTENANCE &8» &cDon't run this command so frequently!
	trigger:
		if arg-1 is not set:
			send "&f"
			send "&8&m                &r &c&lMAINTENANCE &4&lHELP &8&m                "
			send "&c/maintenance &8- &7Sends the help message"
			send "&c/maintenance enable &8- &7Enables maintenance mode"
			send "&c/maintenance disable &8- &7Disables maintenance mode"
			send "&c/maintenance bypass &8- &7Enables your maintenance bypass mode"
			send "&8&m                &r &c&lMAINTENANCE &4&lHELP &8&m                "
			send "&f"
		else if arg-1 is "on" or "true" or "enable":
			if {maintenance} isn't true:
				play sound "block.note_block.didgeridoo" to all players
				broadcast "&f"
				broadcast "  &f〉 &c&lMAINTENANCE &f〈"
				broadcast "&f"
				broadcast "&c%player% &fis conducting a quick maintenance. "
				broadcast "&fThis is just a quick &cmaintenance &fand &cshouldn't &flast long."
				broadcast "&f"
				loop all players:
					if loop-player has permission "maintenance.*":
						send "&c&lMAINTENANCE &8» &c%player% &fhas successfully enabled &cmaintenance mode." to loop-player
				wait 10 seconds
				play sound "block.note_block.didgeridoo" to all players
				broadcast "&f〉 &c&lMAINTENANCE &f〈"
				broadcast "&f"
				broadcast "&cThe server &fwill shut down for maintenance in &c10 seconds."
				broadcast "&cPlease wait patiently &fas we conduct through this process!"
				broadcast "&f"
				wait 5 seconds
				broadcast "&f〉 &c&lMAINTENANCE &f〈"
				broadcast "&f"
				broadcast "&cThe server &fwill shut down for maintenance in &c5 seconds."
				broadcast "&cPlease wait patiently &fas we conduct through this process!"
				broadcast "&f"
				play sound "block.note_block.didgeridoo" to all players
				wait 5 seconds
				set {maintenance} to true
				kick all players due to "&f〉 &c&lMAINTENANCE &f〈 &fWe are running &ca quick maintenance &fon the server. &cPlease &fbe patient as we go through this process."
			else:
				send "&c&lMAINTENANCE &8» &cYou can't turn maintenance on when it's already on!"
		else if arg-1 is "off" or "false" or "disable":
			if {maintenance} is true:
				play sound "block.note_block.pling" at pitch 1.1 to all players
				set {maintenance} to false
				broadcast "&f"
				broadcast "&f〉 &c&lMAINTENANCE &f〈"
				broadcast "&f"
				broadcast "&c%player% &fhas disabled the maintenance mode."
				broadcast "&cRegular players &fwill be able to &cjoin &fthe server again."
				broadcast "&f"
				loop all players:
					if loop-player has permission "maintenance.*":
						send "&c&lMAINTENANCE &8» &c%player% &fhas successfully disabled &cmaintenance mode." to loop-player
					else:
						send "&c&lMAINTENANCE &8» &cYou can't turn maintenance off when it's already off!"

on join:
    if {maintenance} is true:
        if player doesn't have permission "maintenance.bypass":
            kick player due to "&f〉 &c&lMAINTENANCE &f〈 &fWe are running &ca quick maintenance &fon the server. &cPlease &fbe patient as we go through this process."
        else if {maintenance} is false:
            stop
    else if player has permission "maintenance.bypass":
        send "&c&lMAINTENANCE &8» &cMaintenance was enabled but you bypassed it because of your permissions!"

Simple Maintenance Skript 

There are no dependencies. Have fun using it however you want

 

(This skript was very low effort so don't make fun of me if it's bad, only spent 10min on it because my friend asked)

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...