Welcome to SkriptTools.net!

SkriptTools is now part of the skUnity family! skUnity will keep SkriptTools running, updating and adding new features.


- You can now search scripts by author by doing "author:name". For example: "author:nfell2009"

- Login to SkriptTools using your skUnity account to save your favourite scripts and come back to them

Login

Script Viewer

View the code of the script directly in your browser without downloading anything.

Current File: inviteGUI.sk - Download / View on the skUnity Parser

on load:
	send "[SuperGuilds] inviteGUI loaded. [%%35]" to console
sub "guild-invite":
	set {_p} to "%parameter 1%" parsed as player
	set {_anan} to "%uuid of {_p}%"
	if {sg::guildNamePlayer::%{_anan}%} is set:
		set {_players::*} to players
		remove {_p} from {_players::*}
		loop all players:
			if {sg::guildNamePlayer::%uuid of loop-player%} is set:
				remove loop-player from {_players::*}
		if {_players::*} > 0:
			open chest with 5 rows named "%{invite_accept_header}%" to {_p}
			wait 2 ticks
			set {_x} to 0
			loop {_players::*}:
				format slot {_x} of {_p} with player head named "&a%loop-value%" with lore "%{click_invite}%" to close then run "gconsolesudo invite %{_p}% %loop-value%"
				add 1 to {_x}
		else:
			send "%{tag}% %{noInvitePlayer}%" to {_p}
			stop
sub "davetGonder":
	set {_p} to "%parameter 1%" parsed as player				
	set {_guild} to "%parameter 2%" parsed as text
	set {_x} to {invitePlayer}
	replace all "{GUILD}" with "%{_guild}%" in {_x}
	send "%{tag}% %{_x}%" to {_p}
	set {_z} to {acceptWithCommand}
	replace all "{GUILD}" with "%{_guild}%" in {_z}
	send "%{tag}% %{_z}%" to {_p}
	open chest with 1 rows named "%{invite_accept_header}%" to {_p}
	wait 2 ticks
	format slot 0 of {_p} with name tag named "%{invite_from_text}%" with lore "&6%{_guild}%" to be unstealable
	format slot 2 of {_p} with cactus green named "%{button_open}%" to close then run [invoke "davetKabul" from {_p} and {_guild}]
	format slot 6 of {_p} with rose red named "%{button_close}%" to close then run [invoke "davetRed" from {_p} and {_guild}]
	play raw sound "note.pling" at {_p} with pitch 1 volume 0.1
sub "davetRed":
	set {_p} to "%parameter 1%" parsed as player	
	set {_uuid} to "%uuid of {_p}%"
	set {_guild} to "%parameter 2%" parsed as text		
	send "%{tag}% %{cancelInvitePlayer}%" to {_p}
	clear {sg::inviteKimden::%{_uuid}%}
	set {_x} to {cancelInvite}
	replace all "{PLAYER}" with "%{_p}%" in {_x}
	send "%{tag}% %{_x}%" to {sg::guildPlayers::%{_guild}%::*}
sub "davetKabul":
	set {_p} to "%parameter 1%" parsed as player
	set {_uuid} to "%uuid of {_p}%"
	set {_guild} to "%parameter 2%"
	if {sg::guildNamePlayer::%{_uuid}%} is not set:
		set {_Players} to single value "Players" get of "plugins/SuperGuilds/guilds/%{_guild}%.yml" parsed as number
		set {_MaxSlots} to single value "MaxSlots" get of "plugins/SuperGuilds/guilds/%{_guild}%.yml" parsed as number
		if {_Players} is smaller than {_MaxSlots}:
			set {_Leader} to single value "Leader" get of "plugins/SuperGuilds/guilds/%{_guild}%.yml" parsed as player
			set {_x} to {joinguild}
			replace all "{PLAYER}" with "%{_p}%" in {_x}
			set {_guildName} to single value "Name" get of "plugins/SuperGuilds/guilds/%{_guild}%.yml"
			set {sg::guildNamePlayer::%{_uuid}%} to {_guildName}
			set {sg::rankPlayer::%{_uuid}%} to "Member"
			clear {sg::inviteKimden::%{_uuid}%}
			add {_p} to {sg::guildPlayers::%{_guild}%::*}
			send "%{tag}% %{_x}% &2[&a%size of {sg::guildPlayers::%{_guild}%::*}%&7/&a%{_MaxSlots}%&2]" to {sg::guildPlayers::%{_guild}%::*}
			add 1 to {_Players}
			set "Players" to "%{_Players}%" in yaml file "plugins/SuperGuilds/guilds/%{_guildName}%.yml"
			set {_x} to "%{joinedguild}%"
			replace all "{GUILD}" with "%{_guildName}%" in {_x}
			send "%{tag}% %{_x}%" to {_p}
			set {_levelCalc} to 0
			loop {sg::guildPlayers::%{_guildName}%::*}:
				add {sg::playerHonor::%uuid of loop-value%} to {_levelCalc}	
			set {_x} to size of {sg::guildPlayers::%{_guildName}%::*}
			set {_new} to {_levelCalc}/{_x}
			set "Level" to "%{_new}%" in yaml file "plugins/SuperGuilds/guilds/%{_guildName}%.yml"
		else:
			send "%{tag}% %{notenoughslots}%" to {_p}
	else:
		send "%{tag}% %{HasGuild}%" to {_p}