Jump to content

How do I add a delay to my grappling hook? And how do I make it so it only launches you when you first right click on the fishing rod


catsopov

Recommended Posts

Hey so I made this code:

on rightclick with fishing rod:
	if name of tool of player is "Grappling hook":
		push the player upwards with speed 1
		push the player forwards with speed 5

and I do not know how to make it so there is a delay between you grappling away and the next time you can grapple away. And I don't know how to detect the first click only because you have to click 2 times between the grappling. It is hard to explain so you might have to test it on a test server. 

Link to comment
Share on other sites

Here is the cooldown:

on rightclick with fishing rod:
	if name of tool of player is "Grappling hook":
		if difference between now and {GrapplinghookCooldown.%player's uuid%} is less than 5 seconds:
			message "&cPlease wait 5 seconds before you use this again!" to player
		else:
			set {GrapplinghookCooldown.%player's uuid%} to now
			push the player upwards with speed 1
			push the player forwards with speed 5

I don't really know how to do the right click thingy. Maybe try using variables for it?

  • Thanks 1
I used to play Minehut I guess?
Yeah, I still watch the forums for some reason. (15/5/2023)
Link to comment
Share on other sites

4 hours ago, skPizza said:

Here is the cooldown:

on rightclick with fishing rod:
	if name of tool of player is "Grappling hook":
		if difference between now and {GrapplinghookCooldown.%player's uuid%} is less than 5 seconds:
			message "&cPlease wait 5 seconds before you use this again!" to player
		else:
			set {GrapplinghookCooldown.%player's uuid%} to now
			push the player upwards with speed 1
			push the player forwards with speed 5

I don't really know how to do the right click thingy. Maybe try using variables for it?

This works perfectly 🙂 . TY

Link to comment
Share on other sites

Try this:

on rightclick with fishing rod:
	if name of tool of player is "Grappling hook":
		if difference between now and {GrapplinghookCooldown.%player's uuid%} is less than 5 seconds:
			message "&cPlease wait 5 seconds before you use this again!" to player
			set {Graple::%player%} to true
		else:
			set {GrapplinghookCooldown.%player's uuid%} to now
			push the player upwards with speed 1
			push the player forwards with speed 5
			set {Graple::%player's uuid%} to true
		else:
			if {Graple::%player's uuid%} is true:
				send "&cYou can only do this once!" to player
on join:
	if {joins::*} does not contain player's uuid:
		add player's uuid to {joins::*}
		set {Graple::%player's uuid%} to false

I posted this an hour ago, but it didnt post, sos

 

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

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