Jump to content

skript /back command


alecj0217

Recommended Posts

ok so i want a command that whenever you type /back it teleports you to where you were before the last teleport. ex: player is at location 1, teleports to location 2. /back command brings them to location 1. this is what i have, but it only works sometimes. 

on teleport:
	set {backloc::%player's uuid%} to location of player

command /back:
	trigger:
		if {backloc::%player's uuid%} is set:
			teleport player to {backloc::%player's uuid%}
			send "Sending you to your previous location..."
			delete {backloc::%player's uuid%}

on quit:
	if {backloc::%player's uuid%} is set:
		delete {backloc::%player's uuid%}

 

Link to comment
Share on other sites

The issue is skript doesn't detect any teleport or might detect it to late due to lag or other stuff. The reason why essentials /back works is due to it overwriting the usual /tp so they can set their /back location way more reliable. I'd suggest actually making your own /tp command if you want it to work 100% of the time.

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

Hey! idk if you still need it but I made a skript for this (change /skback to /back if you want, i made it like that so I wouldn't interfere with essetialsx):

 

on command "/tp":
	set {backloc::%player's uuid%} to location of player

command /skback:
	trigger:
		if {backloc::%player's uuid%} is set:
			teleport player to {backloc::%player's uuid%}
			send "Sending you to your previous location..."
			delete {backloc::%player's uuid%}

on quit:
	if {backloc::%player's uuid%} is set:
		delete {backloc::%player's uuid%}

 

 

Link to comment
Share on other sites

45 minutes ago, xTomPx said:

Hey! idk if you still need it but I made a skript for this (change /skback to /back if you want, i made it like that so I wouldn't interfere with essetialsx):

 

on command "/tp":
	set {backloc::%player's uuid%} to location of player

command /skback:
	trigger:
		if {backloc::%player's uuid%} is set:
			teleport player to {backloc::%player's uuid%}
			send "Sending you to your previous location..."
			delete {backloc::%player's uuid%}

on quit:
	if {backloc::%player's uuid%} is set:
		delete {backloc::%player's uuid%}

 

 

thats exactly what i have besides the /skback part

Link to comment
Share on other sites

20 hours ago, StarBunnie said:

The issue is skript doesn't detect any teleport or might detect it to late due to lag or other stuff. The reason why essentials /back works is due to it overwriting the usual /tp so they can set their /back location way more reliable. I'd suggest actually making your own /tp command if you want it to work 100% of the time.

ok how would i make a tp command that works like the minecraft tp command

Link to comment
Share on other sites

51 minutes ago, alecj0217 said:

thats exactly what i have besides the /skback part

for me both of them work as intended always, I'm not good at diagnosing issues so it could be on your end or on the server your testing.

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