Jump to content

Grapple hook skript


Lapzzo

Recommended Posts

Grapple Hook

skript

Hey, I made this grapple hook skript, with a cooldown, since there wasn't any good ones online! Enjoy and credit me when using this!

One with tabs:

options:
	servername: servername #Type your server name here!
	grapplename: Grappling hook #Name of what the grapple hook should be called to work!
	cooldowntime: 5 #How long the cooldown should be
on fishing:
	if player's held item is fishing rod named "{@grapplename}":
		if difference between now and {cooldown::%player%} is less than {@cooldowntime} seconds:
			cancel event
			send "&4[&c{@servername}&4] &cYou are currently on cooldown!" to player
		else:
			if "%fish state%" is "CAUGHT" or "REEL_IN" or "IN_GROUND":
				set {nofalldamage.grapplinghook.%player%} to true
				repair player's held item
				set {_ploc.x} to x coordinate of player
				set {_floc.x} to x coordinate of fishing hook
				set {_ang} to {_floc.x} - {_ploc.x}
				set {_ploc.z} to z coordinate of player
				set {_floc.z} to z coordinate of fishing hook
				set {_ang.2} to {_floc.z} - {_ploc.z}
				set velocity of player to new Vector {_ang}, 1, {_ang.2}
				set {cooldown::%player%} to now
command /grapplinghook <player>:
	permission: op
	permission message: &fUnknown command. Type "/help" for help.
	usage: &c/grapplinghook <player>
	trigger:
		give arg-1 fishing rod named "{@grapplename}"
		send "&aYou have &lSUCCESFULLY &aGiven %Arg-1% &aa grappling hook" to player	

One with spaces:

options:
    servername: servername #Type your server name here!
    grapplename: Grappling hook #Name of what the grapple hook should be called to work!
    cooldowntime: 5 #How long the cooldown should be
on fishing:
    if player's held item is fishing rod named "{@grapplename}":
        if difference between now and {cooldown::%player%} is less than {@cooldowntime} seconds:
            cancel event
            send "&4[&c{@servername}&4] &cYou are currently on cooldown!" to player
        else:
            if "%fish state%" is "CAUGHT" or "REEL_IN" or "IN_GROUND":
                set {nofalldamage.grapplinghook.%player%} to true
                repair player's held item
                set {_ploc.x} to x coordinate of player
                set {_floc.x} to x coordinate of fishing hook
                set {_ang} to {_floc.x} - {_ploc.x}
                set {_ploc.z} to z coordinate of player
                set {_floc.z} to z coordinate of fishing hook
                set {_ang.2} to {_floc.z} - {_ploc.z}
                set velocity of player to new Vector {_ang}, 1, {_ang.2}
                set {cooldown::%player%} to now
command /grapplinghook <player>:
    permission: op
    permission message: &fUnknown command. Type "/help" for help.
    usage: &c/grapplinghook <player>
    trigger:
        give arg-1 fishing rod named "{@grapplename}"
        send "&aYou have &lSUCCESFULLY &aGiven %Arg-1% &aa grappling hook" to player    

 

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

48 minutes ago, flashbang9 said:

[15:34:29 ERROR]: Can't understand this expression: fish state (GrapplingHook.sk, line 11: if "%fish state%" is "CAUGHT" or "REEL_IN" or "IN_GROUND":')

 

how can i fix

i am in 1.16.5 with no skript addons

that requires skellet

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

  • 10 months later...
On 9/12/2021 at 9:48 AM, Lapzzo said:

Grapple Hook

skript

Hey, I made this grapple hook skript, with a cooldown, since there wasn't any good ones online! Enjoy and credit me when using this!

One with tabs:

options:
	servername: servername #Type your server name here!
	grapplename: Grappling hook #Name of what the grapple hook should be called to work!
	cooldowntime: 5 #How long the cooldown should be
on fishing:
	if player's held item is fishing rod named "{@grapplename}":
		if difference between now and {cooldown::%player%} is less than {@cooldowntime} seconds:
			cancel event
			send "&4[&c{@servername}&4] &cYou are currently on cooldown!" to player
		else:
			if "%fish state%" is "CAUGHT" or "REEL_IN" or "IN_GROUND":
				set {nofalldamage.grapplinghook.%player%} to true
				repair player's held item
				set {_ploc.x} to x coordinate of player
				set {_floc.x} to x coordinate of fishing hook
				set {_ang} to {_floc.x} - {_ploc.x}
				set {_ploc.z} to z coordinate of player
				set {_floc.z} to z coordinate of fishing hook
				set {_ang.2} to {_floc.z} - {_ploc.z}
				set velocity of player to new Vector {_ang}, 1, {_ang.2}
				set {cooldown::%player%} to now
command /grapplinghook <player>:
	permission: op
	permission message: &fUnknown command. Type "/help" for help.
	usage: &c/grapplinghook <player>
	trigger:
		give arg-1 fishing rod named "{@grapplename}"
		send "&aYou have &lSUCCESFULLY &aGiven %Arg-1% &aa grappling hook" to player	

One with spaces:

options:
    servername: servername #Type your server name here!
    grapplename: Grappling hook #Name of what the grapple hook should be called to work!
    cooldowntime: 5 #How long the cooldown should be
on fishing:
    if player's held item is fishing rod named "{@grapplename}":
        if difference between now and {cooldown::%player%} is less than {@cooldowntime} seconds:
            cancel event
            send "&4[&c{@servername}&4] &cYou are currently on cooldown!" to player
        else:
            if "%fish state%" is "CAUGHT" or "REEL_IN" or "IN_GROUND":
                set {nofalldamage.grapplinghook.%player%} to true
                repair player's held item
                set {_ploc.x} to x coordinate of player
                set {_floc.x} to x coordinate of fishing hook
                set {_ang} to {_floc.x} - {_ploc.x}
                set {_ploc.z} to z coordinate of player
                set {_floc.z} to z coordinate of fishing hook
                set {_ang.2} to {_floc.z} - {_ploc.z}
                set velocity of player to new Vector {_ang}, 1, {_ang.2}
                set {cooldown::%player%} to now
command /grapplinghook <player>:
    permission: op
    permission message: &fUnknown command. Type "/help" for help.
    usage: &c/grapplinghook <player>
    trigger:
        give arg-1 fishing rod named "{@grapplename}"
        send "&aYou have &lSUCCESFULLY &aGiven %Arg-1% &aa grappling hook" to player    

 

Works like a charm keep it up

Link to comment
Share on other sites

  • 1 year later...

use this skript

No cooldown:

on fish:
    if fishing state is reel in:
        if unformatted name of player's tool is "Grappling Hook (Right-Click)":
            if lore of player's tool contains "&8Grapple":
                if {grapple::cooldown::%player's uuid%} isn't set:
                    set {grapple::falldamage::%player's uuid%} to true
                    push player upwards at speed 1
                    push player forwards at speed 2
                    delete {grapple::falldamage::%player's uuid%}
                    set {_item} to player's tool
                    set player's tool to air
                    set player's tool to {_item}

on swap hand item:
    if unformatted name of player's tool is "Grappling Hook (Right-Click)":
        if lore of player's tool contains "&8Grapple":
            cancel event
            send "%nl%&cWarning! Using this item in your offhand will bug out and use durability but not launch you.%nl%"

command /grapplinghook:
    permission: admin
    permission message: &cYou don't have access to this command.
    trigger:
        give fishing rod named "&6Grappling Hook &8(&7Right-Click&8)" with lore "&8Grapple" to player

on damage:
    if "%damage cause%" is "fall":
        if {grapple::cooldown::%victim's uuid%} is set:
            cancel event

 

Cooldown:

on fish:
    if fishing state is reel in:
        if unformatted name of player's tool is "Grappling Hook (Right-Click)":
            if lore of player's tool contains "&8Grapple":
                if {grapple::cooldown::%player's uuid%} isn't set:
                    set {grapple::falldamage::%player's uuid%} to true
                    push player upwards at speed 1
                    push player forwards at speed 2
                    damage player's tool by 10
                    set {grapple::cooldown::%player's uuid%} to 5 seconds from now
                    wait 5 seconds
                    delete {grapple::cooldown::%player's uuid%}
                    delete {grapple::falldamage::%player's uuid%}
                else if {grapple::cooldown::%player's uuid%} is set:
                    send "&cYour grappling hook is on cooldown. &7(%difference between now and {grapple::cooldown::%player's uuid%}%)"
                    set {_item} to player's tool
                    set player's tool to air
                    set player's tool to {_item}

on swap hand item:
    if unformatted name of player's tool is "Grappling Hook (Right-Click)":
        if lore of player's tool contains "&8Grapple":
            cancel event
            send "%nl%&cWarning! Using this item in your offhand will bug out and use durability but not launch you.%nl%"

command /grapplinghook [<player>]:
    permission: admin
    permission message: &cYou don't have access to this command.
    trigger:
        give arg-1 fishing rod named "&6Grappling Hook &8(&7Right-Click&8)" with lore "&8Grapple" to player

on damage:
    if "%damage cause%" is "fall":
        if {grapple::cooldown::%victim's uuid%} is set:
            cancel event

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 1 month later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...