Jump to content

How to get "On Move"/"On Player Move" etc. working?


oShifflee
 Share

Recommended Posts

I've been trying for hours and can't seem to get my "On Move" etc. working. I'm trying to make it where when you move it cancels a /spawn event and I can't figure out why its not working. Here's my current skript: image.png.f4b638a9ac23a52479e474b2767c66ca.png
Can anyone help please? All responses appreciated! 

Link to comment
Share on other sites

The event is on any move: and it needs skquery. Also that really isn't a good way. That would make it the players can't move no matter what since you don't even have an condition to check if the player is using the spawn command. A better way to do that could be this.

command /spawn:
	trigger: &7Usage: &a/spawn
	trigger:
		set {_} to player's location
		loop 5 times:
			send "&aTeleporting you to spawn &7(%loop-value%)"
			wait 1 second
			if player's location is not {_}:
				teleport player to {_}
		teleport player to {spawn}
		send "&aYou have been successfully teleported to spawn."

Not tested but it has no errors and should theoretically work. 

Discord - Tarna256#8675

In-game name - _Tarna_

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

[VIP] - 7/27/2020

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

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

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

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

Link to comment
Share on other sites

I'm trying out your skript and the original is working fine but it isn't what I was looking for, I tried editing it and now its not working. I was trying to make it so whenever you move the teleport gets canceled and you get a message in chat like: "Teleport canceled Reason: You moved". Thanks for trying to help me out with this, I'm very new!

Link to comment
Share on other sites

4 minutes ago, oShifflee said:

I'm trying out your skript and the original is working fine but it isn't what I was looking for, I tried editing it and now its not working. I was trying to make it so whenever you move the teleport gets canceled and you get a message in chat like: "Teleport canceled Reason: You moved". Thanks for trying to help me out with this, I'm very new!

Oh I see. To do that, It's just a simple edit.

command /spawn:
	trigger: &7Usage: &a/spawn
	trigger:
		set {_} to player's location
		loop 5 times:
			send "&aTeleporting you to spawn &7(%loop-value%)"
			wait 1 second
			if player's location is not {_}:
				send "Teleport canceled Reason: You moved."
				stop
		teleport player to {spawn}
		send "&aYou have been successfully teleported to spawn."

 

Discord - Tarna256#8675

In-game name - _Tarna_

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

[VIP] - 7/27/2020

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

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

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

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

Link to comment
Share on other sites

1 hour ago, _Tarna_ said:

Oh I see. To do that, It's just a simple edit.


command /spawn:
	trigger: &7Usage: &a/spawn
	trigger:
		set {_} to player's location
		loop 5 times:
			send "&aTeleporting you to spawn &7(%loop-value%)"
			wait 1 second
			if player's location is not {_}:
				send "Teleport canceled Reason: You moved."
				stop
		teleport player to {spawn}
		send "&aYou have been successfully teleported to spawn."

 

Thank you very much! everything is working well now.

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
 Share



×
×
  • Create New...