Rooms.sk

Created by novastosha

Other available versions. Ordered by newest to oldest versions:

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

options:
	p: &7[&c&lRooms&7]
	prefix: &7[&c&lRooms&7]
	max: 50
	min: 1
# Type 
# Gamemode o' other players
function openSettings(player: player, text: text):
	close {_player}'s inventory
	open chest with 4 rows named "&7Room settings: &c%{_text}%" to {_player}
						
	loop all numbers between 0 and 180:
		format gui slot loop-number of {_player} with gray glass pane named " " to do nothing
	format gui slot 4 of {_player} with red clay named "&7Room name: &c%{_text}%" to do nothing
	format gui slot 9 of {_player} with yellow clay named "&eSet maxuimum players (%{Rooms::Max::%{_text}%}%)" to run function openSetMaxPlayers({_player}, {_text})
	format gui slot 11 of {_player} with light gray clay named "&7Set world type (%{Rooms::WorldType::%{_text}%}%)" to run function openSetWorldType({_player}, {_text})
	if {Rooms::Type::%{_text}%} is "Public":
		format gui slot 13 of {_player} with gray clay named "&8Type (&a%{Rooms::Type::%{_text}%}%&8)" to run function openChangingType({_player}, {_text})
	if {Rooms::Type::%{_text}%} is "Private":
		format gui slot 13 of {_player} with gray clay named "&8Type (&c%{Rooms::Type::%{_text}%}%&8)" to run function openChangingType({_player}, {_text})
	set {_name} to {Rooms::Gamemode::%{_text}%}
	replace all "s" in {_name} with "S"
	replace all "c" in {_name} with "C"
	#format gui slot 15 of {_player} with pink clay named "&dGamemode of invited people! (%{_name}%)" to run function Gamemode({_player}, {_text})
	#format gui slot 17 of {_player} with cyan clay named "&3Gamerules" to run function gameRules({_player}, {_text})
	#format gui slot 19 of {_player} with cyan clay named "&2Save World (%{Rooms::SaveWorld::%{_text}%}%)" to run function saveworldgui({_player}, {_text})
	format gui slot 31 of {_player} with lime clay named "&aCreate!" to run function createWorld({_player}, {_text})
function createWorld(player: player, text: text):
	close {_player}'s inventory
	send "{@p} Recieving room settings..." to {_player}
	wait 1 second
	send "{@p} Checking settings..." to {_player}
	if {Rooms::Max::%{_text}%} is not 0:
		set {_ok} to random integer between 0 and 654841149
		send "{@p} Creating world: %{_text}%" to {_player}
		MAKE console execute "mw create %{_text}%%{_ok}% %{Rooms::WorldType::%{_text}%}%"
		MAKE console execute "mw load %{_text}%%{_ok}%"
		send "{@p} Teleporting to: %{_text}%" to {_player}
		set {_w} to "%{_text}%%{_ok}%" parsed as world
		set {_x} to spawn point of {_w}
		SET {Rooms::WorldName::%{_text}%} to {_w}
		teleport {_player} to {_x}
	else:
		send "{@p} Creation failed! &c(Max players is 0) [Invaild Skript options]" to {_player}
function openSetMaxPlayers(player: player, text: text):
	close {_player}'s inventory
	open chest with 2 rows named "&7Room settings: &c%{_text}% &e(Max Players)" to {_player}
						
	loop all numbers between 0 and 180:
		format gui slot loop-number of {_player} with gray glass pane named " " to do nothing
	format gui slot 3 of {_player} with red clay named "&c-1" to run function removeOne({_player}, {_text})
	format gui slot 5 of {_player} with LIME clay named "&a+1" to run function addOne({_player}, {_text})
	format gui slot 4 of {_player} with yellow clay named "&eMax Players: %{Rooms::Max::%{_text}%}%" to do nothing
	format gui slot 13 of {_player} with lime clay named "&aDone!" to run function openSettings({_player}, {_text})
function openSetWorldType(player: player, text: text):
	close {_player}'s inventory
	open chest with 2 rows named "&7Room settings: &c%{_text}% &7(WorldType)" to {_player}
						
	loop all numbers between 0 and 180:
		format gui slot loop-number of {_player} with gray glass pane named " " to do nothing
	format gui slot 2 of {_player} with green clay named "&aFlat" to run function setWorldType({_player}, {_text}, "FlatLand")
	set line 1 of lore of slot 2 of {_player}'s current inventory to " "
	set line 2 of lore of slot 2 of {_player}'s current inventory to "&7Sets world to a normal SuperFlat Type World!"
	set line 3 of lore of slot 2 of {_player}'s current inventory to "  "
	format gui slot 4 of {_player} with lime clay named "&aNormal" to run function setWorldType({_player}, {_text}, "Normal")
	set line 1 of lore of slot 4 of {_player}'s current inventory to " "
	set line 2 of lore of slot 4 of {_player}'s current inventory to "&7Sets world to a Normal Type World!"
	set line 3 of lore of slot 4 of {_player}'s current inventory to "  "
	format gui slot 6 of {_player} with gray clay named "&7Empty" to run function setWorldType({_player}, {_text}, "Empty")
	set line 1 of lore of slot 6 of {_player}'s current inventory to " "
	set line 2 of lore of slot 6 of {_player}'s current inventory to "&7Sets world to a Void Type World!"
	set line 3 of lore of slot 6 of {_player}'s current inventory to "&c&oWARNING: &7&oFalling into the void will cause"
	set line 4 of lore of slot 6 of {_player}'s current inventory to "&7&odirect kick from the world!"
	set line 5 of lore of slot 6 of {_player}'s current inventory to "  "
	format gui slot 13 of {_player} with lime clay named "&aDone!" to run function openSettings({_player}, {_text})
function Gamemode(player: player, text: text):
	close {_player}'s inventory
	open chest with 2 rows named "&7Room settings: &c%{_text}% &d(Gamemode)" to {_player}
						
	loop all numbers between 0 and 180:
		format gui slot loop-number of {_player} with gray glass pane named " " to do nothing
	format gui slot 2 of {_player} with white clay named "&fCreative" to run function setGm({_player}, {_text}, creative)
	set line 1 of lore of slot 2 of {_player}'s current inventory to " "
	set line 2 of lore of slot 2 of {_player}'s current inventory to "&7Sets Default gamemode to: &fCreative"
	set line 3 of lore of slot 2 of {_player}'s current inventory to "  "
	format gui slot 4 of {_player} with red clay named "&cSurvival" to run function setGm({_player}, {_text}, survival)
	set line 1 of lore of slot 4 of {_player}'s current inventory to " "
	set line 2 of lore of slot 4 of {_player}'s current inventory to "&7Sets Default gamemode to: &cSurvival"
	set line 3 of lore of slot 4 of {_player}'s current inventory to "  "
	format gui slot 6 of {_player} with gray clay named "&8Spectator" to run function setGm({_player}, {_text}, spectator)
	set line 1 of lore of slot 6 of {_player}'s current inventory to " "
	set line 2 of lore of slot 6 of {_player}'s current inventory to "&7Sets Default gamemode to: &8Spectator"

	set line 5 of lore of slot 6 of {_player}'s current inventory to "  "
	format gui slot 13 of {_player} with lime clay named "&aDone!" to run function openSettings({_player}, {_text})
function openChangingType(player: player, text: text):
	close {_player}'s inventory
	open chest with 2 rows named "&7Room settings: &c%{_text}% &8(Type)" to {_player}
						
	loop all numbers between 0 and 180:
		format gui slot loop-number of {_player} with gray glass pane named " " to do nothing
	format gui slot 3 of {_player} with green clay named "&aPublic" to run function setType({_player}, {_text}, "Public")
	set line 1 of lore of slot 3 of {_player}'s current inventory to " "
	set line 2 of lore of slot 3 of {_player}'s current inventory to "&7Sets the Type of room to &aPUBLIC"
	set line 3 of lore of slot 3 of {_player}'s current inventory to "   "
	set line 4 of lore of slot 3 of {_player}'s current inventory to "&c&oPLEASE NOTE: &7&oAnyone can access this room"
	set line 5 of lore of slot 3 of {_player}'s current inventory to "&7&oby just entering room list!"
	set line 6 of lore of slot 3 of {_player}'s current inventory to "    "
	format gui slot 5 of {_player} with gray clay named "&cPrivate" to run function setType({_player}, {_text}, "Private")
	set line 1 of lore of slot 5 of {_player}'s current inventory to " "
	set line 2 of lore of slot 5 of {_player}'s current inventory to "&7Sets the Type of room to &cPRIVATE"
	set line 3 of lore of slot 5 of {_player}'s current inventory to "&c&oINFO: &7&oNo one can enter this room"
	set line 4 of lore of slot 5 of {_player}'s current inventory to "&7&oexept people you invite!"
	set line 5 of lore of slot 5 of {_player}'s current inventory to "  "
	format gui slot 13 of {_player} with lime clay named "&aDone!" to run function openSettings({_player}, {_text})
function setWorldType(player: player, text: text, text2: text):
	set {Rooms::WorldType::%{_text}%} to {_text2}
	send "{@prefix} WorldType of room has been set to: &c%{_text2}%" to {_player}
function setGm(player: player, text: text, gamemode: gamemode):
	set {_name} to {Rooms::Gamemode::%{_text}%}
	replace all "s" in {_name} with "S"
	replace all "c" in {_name} with "C"
	set {Rooms::Gamemode::%{_text}%} to {_gamemode}
	send "{@prefix} Gamemode of room has been set to: &c%{_name}%" to {_player}
function setType(player: player, text: text, text2: text):
	set {Rooms::Type::%{_text}%} to {_text2}
	send "{@prefix} Type of room has been set to: &c%{_text2}%" to {_player}
function removeOne(player: player, text: text):
	set {_new} to {Rooms::Max::%{_text}%} - 1
	if {_new} is bigger than 0:
		if {_new} is not {@min}:
			remove 1 from {Rooms::Max::%{_text}%}
			format gui slot 4 of {_player} with yellow clay named "&eMax Players: %{Rooms::Max::%{_text}%}%" to do nothing
	else:
		send "&cYou can't remove any more!" to {_player}
function addOne(player: player, text: text):
	set {_new} to {Rooms::Max::%{_text}%} + 1
	if {_new} is not bigger than {@max}:
		add 1 to {Rooms::Max::%{_text}%}
		format gui slot 4 of {_player} with yellow clay named "&eMax Players: %{Rooms::Max::%{_text}%}%" to do nothing
	else:
		send "&cYou can't add any more!" to {_player}
function updateGui(player: player):
	set {_slot} to 10
	loop all numbers between 0 and 180:
		format gui slot loop-number of {_player} with gray glass pane named " " to do nothing
	loop {Rooms::*}:

		if loop-value is loop-value:
			if {Rooms::Type::%loop-value%} is "Public":
				if {Rooms::Players::%loop-value%} is smaller than {Rooms::Max::%loop-value%}:
					
					format gui slot {_slot} of {_player} with lime clay named "&a%loop-value%" to run function joinRoom({_player}, loop-value)
					set line 1 of lore of slot {_slot} of {_player}'s current inventory to " "
					set line 2 of lore of slot {_slot} of {_player}'s current inventory to "&a&l---------------------------------"
					set line 3 of lore of slot {_slot} of {_player}'s current inventory to "  "
					set line 4 of lore of slot {_slot} of {_player}'s current inventory to "                     &a&lJOINABLE!"
					set line 5 of lore of slot {_slot} of {_player}'s current inventory to "   "
					set line 6 of lore of slot {_slot} of {_player}'s current inventory to "&7Players: &e%{Rooms::Players::%loop-value%}%/%{Rooms::Max::%loop-value%}%"
					set line 7 of lore of slot {_slot} of {_player}'s current inventory to "    "
					set line 8 of lore of slot {_slot} of {_player}'s current inventory to "&7Type: &aPublic"
					set line 9 of lore of slot {_slot} of {_player}'s current inventory to "     "
					set line 10 of lore of slot {_slot} of {_player}'s current inventory to "&7Owner: &2%{Rooms::Owner::%loop-value%}%"
					set line 11 of lore of slot {_slot} of {_player}'s current inventory to "      "
					set line 12 of lore of slot {_slot} of {_player}'s current inventory to "&7WorldType: &d%{Rooms::WorldType::%loop-value%}%"
					set line 13 of lore of slot {_slot} of {_player}'s current inventory to "       "
					set line 14 of lore of slot {_slot} of {_player}'s current inventory to "&7Server: &d%{Rooms::WorldName::%loop-value%}%"
					set line 15 of lore of slot {_slot} of {_player}'s current inventory to "&a&l---------------------------------"
					set line 16 of lore of slot {_slot} of {_player}'s current inventory to "        "
				else:
					format gui slot {_slot} of {_player} with red clay named "&4%loop-value%" to do nothing
					set line 1 of lore of slot {_slot} of {_player}'s current inventory to " "
					set line 2 of lore of slot {_slot} of {_player}'s current inventory to "&4&l---------------------------------"
					set line 3 of lore of slot {_slot} of {_player}'s current inventory to "  "
					set line 4 of lore of slot {_slot} of {_player}'s current inventory to "                        &4&lFULL!"
					set line 5 of lore of slot {_slot} of {_player}'s current inventory to "   "
					set line 6 of lore of slot {_slot} of {_player}'s current inventory to "&7Players: &e%{Rooms::Players::%loop-value%}%/%{Rooms::Max::%loop-value%}%"
					set line 7 of lore of slot {_slot} of {_player}'s current inventory to "    "
					set line 8 of lore of slot {_slot} of {_player}'s current inventory to "&7Type: &aPublic"
					set line 9 of lore of slot {_slot} of {_player}'s current inventory to "     "
					set line 10 of lore of slot {_slot} of {_player}'s current inventory to "&7Owner: &2%{Rooms::Owner::%loop-value%}%"
					set line 11 of lore of slot {_slot} of {_player}'s current inventory to "      "
					set line 12 of lore of slot {_slot} of {_player}'s current inventory to "&7WorldType: &d%{Rooms::WorldType::%loop-value%}%"
					set line 13 of lore of slot {_slot} of {_player}'s current inventory to "       "
					set line 14 of lore of slot {_slot} of {_player}'s current inventory to "&7Server: &d%{Rooms::WorldName::%loop-value%}%"
					set line 15 of lore of slot {_slot} of {_player}'s current inventory to "&4&l---------------------------------"
					set line 16 of lore of slot {_slot} of {_player}'s current inventory to "        "
			add 1 to {_slot}
		
on quit:
	if {Rooms::Connected::%uuid of player%} is true:
		if {Rooms::HasRoom::%uuid of player%} is true:
			make player execute "/rooms leave"
function joinRoom(player: player, text: text):
	set {_dk} to uuid of {_player}
	broadcast {_dk}
	set {Rooms::Name::%{_dk}%} to {_text}
	add {_player} to {Rooms::PlayersAlive::%{Rooms::Name::%{_dk}%}%::*}
	add 1 to {Rooms::Players::%{Rooms::Name::%{_dk}%}%}
	set {Rooms::Connected::%{_dk}%} to true
	set {Rooms::HasRoom::%{_dk}%} to true
	set {Rooms::CurrentRoomCTO::%{_dk}%} to {_player}
	loop {Rooms::PlayersAlive::%{Rooms::Name::%{_dk}%}%::*}:
		send "{@p} &c%{_player}%&7 joined your room!" to loop-value
	set {_x} to world of {Rooms::Owner::%{Rooms::Name::%{_dk}%}%}
	teleport  {_player} to spawn point of {_x}
every 1 second:
	loop all players:
		if name of loop-player's current inventory is "&7Room list":
			updateGui(loop-player)
#[<>]
command f:
	trigger:
		set {Rooms::Connected::%uuid of player%} to true
		set {Rooms::HasRoom::%uuid of player%} to true
command rooms [<text>] [<text>] [<text>]:
	trigger:
	
		if arg 1 is "st":
			openSettings(player, {Rooms::Name::%uuid of player%})
		if arg 1 is "create":
			if arg 2 is set:
				if {Rooms::Connected::%uuid of player%} is false:
					if {Rooms::HasRoom::%uuid of player%} is false:
						set {Rooms::Connected::%uuid of player%} to true
						set {Rooms::Name::%uuid of player%} to arg 2
						set {Rooms::%arg 2%} to arg 2
						set {Rooms::CurrentRoomCTO::%uuid of player%} to player
						set {Rooms::Max::%{Rooms::Name::%uuid of player%}%} to {@min}
						set {Rooms::WorldType::%{Rooms::Name::%uuid of player%}%} to "Normal"
						set {Rooms::Type::%{Rooms::Name::%uuid of player%}%} to "Private"
						set {Rooms::Gamemode::%{Rooms::Name::%uuid of player%}%} to survival
						set {Rooms::Players::%{Rooms::Name::%uuid of player%}%} to 1
						set {Rooms::Owner::%{Rooms::Name::%uuid of player%}%} to player
						set {Rooms::SaveWorld::%{Rooms::Name::%uuid of player%}%} to false
						add player to {Rooms::PlayersAlive::%{Rooms::Name::%uuid of player%}%::*}
						set {Rooms::HasRoom::%uuid of player%} to true
						
						send "{@p} Created room with name: &c%arg 2%"
						openSettings(player, arg 2)

					else:
						send "&cYou are in a room!"
				else:
					send "&cYou are currently connected to room of %{Rooms::CurrentRoomCTO::%uuid of player%}%"
			else:
				send "&cPlease type a name for your room"
		if arg 1 is "list":
			if {Rooms::Connected::%uuid of player%} is false:
				if {Rooms::HasRoom::%uuid of player%} is false:			
					open chest with 6 rows named "&7Room list" to player
					updateGui(player)
		if arg 1 is "leave":
			if {Rooms::Connected::%uuid of player%} is true:
				if {Rooms::HasRoom::%uuid of player%} is true:
					if {Rooms::Owner::%{Rooms::Name::%uuid of player%}%} is player:
						send "{@p} Leaving your room..."
						loop {Rooms::PlayersAlive::%{Rooms::Name::%uuid of player%}%::*}:
							send "{@p} &c%player%&7 left your room!" to loop-value
							remove loop-value from {Rooms::loop-valuesAlive::%{Rooms::Name::%uuid of loop-value%}%::*}
							remove 1 from {Rooms::loop-values::%{Rooms::Name::%uuid of loop-value%}%}
							set {Rooms::Connected::%uuid of loop-value%} to false
							set {Rooms::HasRoom::%uuid of loop-value%} to false
							clear {Rooms::CurrentRoomCTO::%uuid of loop-value%}
							if loop-value is not player:
								clear {Rooms::Name::%uuid of loop-value%}

							teleport loop-value to {Rooms::FallBack}
						clear {Rooms::Max::%{Rooms::Name::%uuid of player%}%}
						clear {Rooms::WorldType::%{Rooms::Name::%uuid of player%}%}
						clear {Rooms::Type::%{Rooms::Name::%uuid of player%}%}
						clear {Rooms::Gamemode::%{Rooms::Name::%uuid of player%}%}
						clear {Rooms::Players::%{Rooms::Name::%uuid of player%}%}
						clear {Rooms::Owner::%{Rooms::Name::%uuid of player%}%}
						clear {Rooms::SaveWorld::%{Rooms::Name::%uuid of player%}%}
						clear {Rooms::PlayersAlive::%{Rooms::Name::%uuid of player%}%::*}
						remove player from {Rooms::PlayersAlive::%{Rooms::Name::%uuid of player%}%::*}
						remove 1 from {Rooms::Players::%{Rooms::Name::%uuid of player%}%}
						
						set {Rooms::Connected::%uuid of player%} to false
						set {Rooms::HasRoom::%uuid of player%} to false
						clear {Rooms::CurrentRoomCTO::%uuid of player%}
						
						teleport player to {Rooms::FallBack}
						if {Rooms::SaveWorld::%{Rooms::Name::%uuid of player%}%} is false:
							send "{@p} Deleting your world..."
							make console execute "mw delete %{Rooms::WorldName::%{Rooms::Name::%uuid of player%}%}%"
						clear {Rooms::Name::%uuid of player%}
					else:
						send "{@p} Leaving the current room..."
						loop {Rooms::PlayersAlive::%{Rooms::Name::%uuid of player%}%::*}:
							send "{@p} &c%player%&7 left your room!" to loop-value
						remove player from {Rooms::PlayersAlive::%{Rooms::Name::%uuid of player%}%::*}
						remove 1 from {Rooms::Players::%{Rooms::Name::%uuid of player%}%}
						set {Rooms::Connected::%uuid of player%} to false
						set {Rooms::HasRoom::%uuid of player%} to false
						clear {Rooms::CurrentRoomCTO::%uuid of player%}
						clear {Rooms::Name::%uuid of player%}
						teleport player to {Rooms::FallBack}
		if arg 1 is "setfallbackworld" or "sfbw":
			if player has permission "rooms.sfbw":
				set {Rooms::FallBack} to location of player
				send "{@p} Set the fallback location to: &c%location of player%"
		if arg 1 is "invite":
			if arg 2 is set:
				if {Rooms::Players::%{Rooms::Name::%uuid of player%}%} is smaller than {Rooms::Max::%{Rooms::Name::%uuid of player%}%}:
					send "passed player ch"
					if {Rooms::Connected::%uuid of player%} is true:
						if {Rooms::HasRoom::%uuid of player%} is true:
							if {Rooms::Owner::%{Rooms::Name::%uuid of player%}%} is player:
								set {_player} to arg 2 parsed as player
								send "{@p} Invited %{_player}% to your room! His has &c60 seconds&7 to accept"
								set {Rooms::Invited::%player%::%{_player}%} to player
								set {Rooms::Invited::%{_player}%::%player%} to {_player}
								set {Rooms::Invitedd::%{_player}%::%player%} to {Rooms::Name::%uuid of player%}							
								send "{@p} &c%player%&7invited you to their room! You have &c60 seconds&7 to accept" to {_player}
		if arg 1 is "accept":
			if arg 2 is set:
				if {Rooms::Connected::%uuid of player%} is false:
					if {Rooms::HasRoom::%uuid of player%} is false:
						
						set {_player} to arg 2 parsed as player
						if {Rooms::Invited::%{_player}%::%player%} is set:
							set {Rooms::Name::%uuid of player%} to {Rooms::Invitedd::%player%::%{_player}%}
							clear {Rooms::Invited::%{_player}%::%player%}
							clear {Rooms::Invited::%player%::%{_player}%}

							add player to {Rooms::PlayersAlive::%{Rooms::Name::%uuid of player%}%::*}
							add 1 to {Rooms::Players::%{Rooms::Name::%uuid of player%}%}
							set {Rooms::Connected::%uuid of player%} to true
							set {Rooms::HasRoom::%uuid of player%} to true
							set {Rooms::CurrentRoomCTO::%uuid of player%} to {_player}
							loop {Rooms::PlayersAlive::%{Rooms::Name::%uuid of player%}%::*}:
								send "{@p} &c%player%&7 joined your room!" to loop-value
							set {_x} to world of {_player}
							teleport player to spawn point of {_x}
on death:
	if {Rooms::Connected::%uuid of player%} is true:
		if {Rooms::HasRoom::%uuid of player%} is true:
			make player execute "/rooms leave"
on world change:
	if {Rooms::Connected::%uuid of player%} is true:
		if {Rooms::HasRoom::%uuid of player%} is true:
			if event-world is not {Rooms::WorldName::%{Rooms::Name::%uuid of player%}%} :
				
				make player execute "/rooms leave"
on inventory close:
	if event-inventory's name contains "&7Rooms":
		openSettings(player, {Rooms::Name::%uuid of player%})
on join:
	if {Rooms::Connected::%uuid of player%} is not set:
		set {Rooms::Connected::%uuid of player%} to false
	if {Rooms::HasRoom::%uuid of player%} is not set:
		set {Rooms::HasRoom::%uuid of player%} to false	
	if {Rooms::Connected::%uuid of player%} is true:
		if {Rooms::HasRoom::%uuid of player%} is true:
			make player execute "/rooms leave"