grapple.sk

Created by Meex

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:
#	  sSSSSs   .S_sSSs     .S_SSSs     .S_sSSs     .S_sSSs    S.        sSSs
#	 d%%%%SP  .SS~YS%%b   .SS~SSSSS   .SS~YS%%b   .SS~YS%%b   SS.      d%%SP
#	d%S'      S%S   `S%b  S%S   SSSS  S%S   `S%b  S%S   `S%b  S%S     d%S'  
#	S%S       S%S    S%S  S%S    S%S  S%S    S%S  S%S    S%S  S%S     S%S   
#	S&S       S%S    d*S  S%S SSSS%S  S%S    d*S  S%S    d*S  S&S     S&S   
#	S&S       S&S   .S*S  S&S  SSS%S  S&S   .S*S  S&S   .S*S  S&S     S&S_Ss
#	S&S       S&S_sdSSS   S&S    S&S  S&S_sdSSS   S&S_sdSSS   S&S     S&S~SP
#	S&S sSSs  S&S~YSY%b   S&S    S&S  S&S~YSSY    S&S~YSSY    S&S     S&S   
#	S*b `S%%  S*S   `S%b  S*S    S&S  S*S         S*S         S*b     S*b   
#	S*S   S%  S*S    S%S  S*S    S*S  S*S         S*S         S*S.    S*S.  
#	 SS_sSSS  S*S    S&S  S*S    S*S  S*S         S*S          SSSbs   SSSbs
#	  Y~YSSY  S*S    SSS  SSS    S*S  S*S         S*S           YSSP    YSSP
#	          SP                 SP   SP          SP                        
#	          Y                  Y    Y           Y                         
#
#		 _                                      
#		| |                                     
#		| |__  _   _   _ __ ___   ___  _____  __
#		| '_ \| | | | | '_ ` _ \ / _ \/ _ \ \/ /
#		| |_) | |_| | | | | | | |  __/  __/>  < 
#		|_.__/ \__, | |_| |_| |_|\___|\___/_/\_\
#		        __/ |                           
#		       |___/                            
#
#
# Settings:
	version_check: true # Set to false if you don't want Grapple to check for new versions
	version_message: true # Set to false if you don't want a update message - only visible for players with the permission grapple.main

	prefix: "&c[&6Grapple&c]&r" # The prefix for the commands
	message: "&fYou gave &e[player]&f a &6grappling hook&f." # What the give message would be.
	permission_message: &cSorry, you don't have permission for this command. # Message the player will receive when they don't have permissions - only for commands

	name: "&6Grappling Hook" # What the name of the grappling hook should be
	glowing: true # If the fishing rod should have a glowing/enchanted look.

	self_velocity: 2 # How fast and far the player will go when the player grapple's
	players_velocity: 2 # How fast and far the player's will go when a player grapple's them
	entity_velocity: 3 # How fast and far entity's will go when a player grapple's them
	item_velocity: 1 # How fast and far an item will go when a player grapple's it

	only_in_ground: false # If the grappling hook needs to be in the ground to work * It's glitchy if it's enabled
	fall_damage_on_use: false # False if you don't want to give falldamage if player is holding a grappling hook
	# BLOCKWHITELIST - blockwhitelist can be enabled in the blockwhitelist config (plugins/Grapple/blockwhitelist.yml)



#
#
# >>> You should not change anything below the line unless you know what you are doing
# >>> You should not change anything below the line unless you know what you are doing
# >>> You should not change anything below the line unless you know what you are doing
#
#

	version: 0.3 Pre-alpha # Don't change this, this is your current version of Grapple
	BlockWhitelist_file: "plugins/Grapple/blockwhitelist.yml" # Don't change this, this is the location for the BlockWhitelist file ! Changing this crashes the skript ! 
	Config_Version: 0.3



command /grapplinghook <player=%player%>:
	aliases: /gh, /grapple
	description: Receive a grapplinghook.
	permission:	grapple.give
	permission message: {@permission_message}
	executable by: players
	trigger:
		set {_message} to join {@prefix} and {@message} with delimiter " "
		replace all "[player]" with "%arg-1%" in {_message}
		message {_message} to player
		if {@glowing} is true:
			give arg-1 1 of glowing fishing rod named {@name}
		else:
			give arg-1 1 of fishing rod named {@name}

command /ghm <text=help> [<text>]:
	description: Grapple main command
	permission: grapple.main
	permission message: {@permission_message}
	trigger:
		if arg-1 = "help":
			if arg-2 = "cmds" or "commands":
				message ""
				message {@prefix}
				message "&fAll the commands:"
				message ""
				message "&e/&6grapple <&eplayer&6> &fto give the player a grapplinghook (if no player is specified the command executer will get it.)"
				message ""
				message "&e/&6ghm &ehelp &6> &fto see help."
				message "&e/&6ghm &eversion &6> &fto see the current &6Grapple &fversion."
				message "&e/&6ghm &ereload &6>&f to reload &6Grapple&f."
				message ""
				message "&e/&6ghm &eblock get&6 > &fto see the name of the block you are standing on (same syntax that you would add to the BlockWhitelist config)."
				message "&e/&6ghm &eblock list&6 > &fto see all the blocks that are in the BlockWhitelist."
				message "&e/&6ghm &eblock add&6 > &fto add the block you are standing on to the BlockWhitelist."
				message "&e/&6ghm &eblock remove&6 > &fto remove the block you are standing on from the BlockWhitelist."
				message "&e/&6ghm &eblock toggle&6 > &fto enable or disable the BlockWhitelist."
				message ""
			else:
				message ""
				message {@prefix}
				message "&fYou tried the command &e/&6ghm &fbut you missed the second argrument."
				message "&e/&6ghm help &ecommands&6 > &fto see all available commands."
		else if arg-1 = "ver" or "version":
			set {_message} to join {@prefix} and "&fYou are currently running &6Grapple &fversion:&e {@version}" with delimiter " "
			message {_message}
		else if arg-1 = "reload":
			set {_message} to join {@prefix} and "&cCurrently reloading &6Grapple" with delimiter " "
			message {_message}
			set {_p} to sender
			set {grapple.reload} to {_p}
			wait 7 ticks
			console command "skript reload grapple.sk"
		else if arg-1 = "block":
			if arg-2 = "get":
				if executor is not console:
					set {_block} to block below player
					set {_message} to join {@prefix} and "&fYou are currently standing on &6%{_block}%" with delimiter " "
					message {_message}
			else if arg-2 = "list":
				set {_list::*} to skutil yaml list "BlockWhitelist" from file {@BlockWhitelist_file}
				set {_message} to join {@prefix} and "&fYou have &6%size of {_list::*}% &fblocks in your &6BlockWhitelist&f." with delimiter " "
				message {_message}
				loop {_list::*}:
					message "&f&l- &6%loop-value%"
			else if arg-2 = "add":
				if executor is not console:
					set {_list::*} to skutil yaml list "BlockWhitelist" from file {@BlockWhitelist_file}
					set {_block} to block below player
					set {_block} to "%{_block}%"
					if {_list::*} does not contain {_block}:
						add {_block} to skutil yaml list "BlockWhitelist" from file {@BlockWhitelist_file}
						set {_message} to join {@prefix} and "&aYou have added &6%{_block}% &ato your &6BlockWhitelist&a!" with delimiter " "
						message {_message}
					else if {_list::*} contains {_block}:
						set {_message} to join {@prefix} and "&cYou already have &6%{_block}% &cin your &6BlockWhitelist&c!" with delimiter " "
						message {_message}
			else if arg-2 = "remove":
				if executor is not console:
					set {_list::*} to skutil yaml list "BlockWhitelist" from file {@BlockWhitelist_file}
					set {_block} to block below player
					set {_block} to "%{_block}%"
					if {_list::*} contains {_block}:
						remove {_block} from skutil yaml list "BlockWhitelist" from file {@BlockWhitelist_file}
						set {_message} to join {@prefix} and "&aYou have removed &6%{_block}% &afrom your &6BlockWhitelist&a!" with delimiter " "
						message {_message}
					else if {_list::*} does not contain {_block}:
						set {_message} to join {@prefix} and "&cYou don't have &6%{_block}% &cin your &6BlockWhitelist&c!" with delimiter " "
						message {_message}
			else if arg-2 = "toggle":
				set {_enabled} to skutil yaml value "Enabled" from file {@BlockWhitelist_file}
				message {_enabled}
				if {_enabled} = true:
					set skutil yaml value "Enabled" from file {@BlockWhitelist_file} to false
					set {_message} to join {@prefix} and "&fYou have &cDisabled&f the &eBlockWhitelist&f!" with delimiter " "
					message {_message}
				else:
					set skutil yaml value "Enabled" from file {@BlockWhitelist_file} to true
					set {_message} to join {@prefix} and "&fYou have &aEnabled&f the &eBlockWhitelist&f!" with delimiter " "
					message {_message}
			else if arg-2 is not set:
				message ""
				message {@prefix}
				message "&fYou tried the command &e/&6ghm &eblock &fbut you missed the second argrument."
				message "&e/&6ghm &eblock get&6 > &fto see the name of the block you are standing on (same syntax that you would add to the BlockWhitelist config)."
				message "&e/&6ghm &eblock list&6 > &fto see all the blocks that are in the BlockWhitelist."
				message "&e/&6ghm &eblock add&6 > &fto add the block you are standing on to the BlockWhitelist."
				message "&e/&6ghm &eblock remove&6 > &fto remove the block you are standing on from the BlockWhitelist."
				message "&e/&6ghm &eblock toggle&6 > &fto enable or disable the BlockWhitelist."
		else:
			message ""
			message {@prefix}
			message "&fYou tried the command &e/&6ghm &fbut you missed the first argrument."
			message "&e/&6ghm help &ecommands&6 > &fto see all available commands."

on load:
	if dir "plugins/Grapple" does not exist:
		create dir "plugins/Grapple"
	if file "plugins/Grapple/blockwhitelist.yml" doesn't exist:
		download file from "https://raw.githubusercontent.com/MaxxieGamers/Grapple/master/blockwhitelist.yml" to file "plugins/Grapple/blockwhitelist.yml"
	if {grapple.reload} is set:
		wait 7 ticks
		set {_message} to join {@prefix} and "&aSuccesfully reloaded &6Grapple" with delimiter " "
		message {_message} to {grapple.reload}
		clear {grapple.reload}
	else:
		set {_message} to join {@prefix} and "&fEnabling &6Grapple &f{@version}" with delimiter " "
		message {_message} to console
		wait 2 seconds
		if {@version_check} = true:
			set {_version::*} to url "https://pastebin.com/raw/GWSeaNTw"'s contents
			set {_vers} to {_version::1}
			set {_versa} to "{@version}" 
			if {_versa} is not {_vers}:
				set {_message} to join {@prefix} and "&aNew update available: &e%{_version::1}%" with delimiter " "
				message {_message} to console
				if {@version_message} = true:
					loop all players:
						if loop-player has permission "grapple.main":
							message {_message} to loop-player
							message "&fUpdate contains:" to loop-player
							loop {_version::*}:
								if loop-value-2 is not {_version::1}:
									message colored loop-value-2 to loop-player


on player fishing:
	if name of tool of player is {@name}:
		if caught entity is not set:
			if {@only_in_ground} is true:
				if fishing state is in ground:
					if player has the permission "grapple.pull.self":
						set {_enabled} to skutil yaml value "Enabled" from file {@BlockWhitelist_file}
						set {_whitelist} to skutil yaml value "UseAsWhitelist" from file {@BlockWhitelist_file}
						if {_enabled} is true:
							set {_block} to block below location of hook
							set {_list::*} to skutil yaml list "BlockWhitelist" from file {@BlockWhitelist_file}
							if {_whitelist} is true:
								if {_list::*} contains "%{_block}%":
									push player (direction from player to location of hook) at speed {@self_velocity}
							else:
								if {_list::*} does not contain "%{_block}%":
									push player (direction from player to location of hook) at speed {@self_velocity}
						else:
							push player (direction from player to location of hook) at speed {@self_velocity}
			else:
				if fishing state is not fishing:
					if player has the permission "grapple.pull.self":
						set {_enabled} to skutil yaml value "Enabled" from file {@BlockWhitelist_file}
						set {_whitelist} to skutil yaml value "UseAsWhitelist" from file {@BlockWhitelist_file}
						if {_enabled} is true:
							set {_block} to block below location of hook
							set {_list::*} to skutil yaml list "BlockWhitelist" from file {@BlockWhitelist_file}
							if {_whitelist} is true:
								if {_list::*} contains "%{_block}%":
									push player (direction from player to location of hook) at speed {@self_velocity}
							else:
								if {_list::*} does not contain "%{_block}%":
									push player (direction from player to location of hook) at speed {@self_velocity}
						else:
							push player (direction from player to location of hook) at speed {@self_velocity}
		if caught entity is set:
			if caught entity is a dropped item:
				if player has the permission "grapple.pull.items":
					push caught entity (direction from caught entity to location of player) at speed {@item_velocity}
			else if caught entity is a player:
				if caught entity doesn't have permission "grapple.nopull":
					if player has the permission "grapple.pull.players":
						push caught entity (direction from caught entity to location of player) at speed {@players_velocity}
			else:
				if player has the permission "grapple.pull.entities":
					push caught entity (direction from caught entity to location of player) at speed {@entity_velocity}

on damage:
	if {@fall_damage_on_use} is false:
		if damage cause is fall:
			if name of tool of victim is {@name}:
				cancel event