WaterBreatheZs Posted April 29, 2023 Share Posted April 29, 2023 I was trying to make an ability that when a player right click an item, it sets a waypoint for the player and nearby players. Then teleport the player back to the waypoint after a few seconds. Please let me know if it's possible. Link to comment Share on other sites More sharing options...
xcfgdfg Posted April 29, 2023 Share Posted April 29, 2023 on load: set {item} to stick named "Waypoint" on right click holding {item}: set {waypoint} to player's location # (if this doesnt work, you could replace location with coordinates) wait 1 second teleport player to {waypoint} loop players within 5 meters of the player: teleport loop-player to {waypoint} I would suggest adding a cooldown to the feature, since it could be spammed like in milliseconds. With cooldown: on load: set {item} to stick named "Waypoint" set {cooldown.%player%} to false on right click holding {item}: if {cooldown.%player%} is true: send "You are on cooldown!" to player stop if {cooldown.%player%} is false: set {cooldown.%player%} to true set {waypoint} to player's location # (if this doesnt work, you could replace location with coordinates) wait 1 second teleport player to {waypoint} loop players within 5 meters of the player: teleport loop-player to {waypoint} set {cooldown.%player%} to false stop ^ You could also add that on join the player's cooldown is reset, in the case they leave the server while on cooldown. (I think that affects it, but im noit sure) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now