Jump to content

The manhunt compass


CPlock32

Recommended Posts

So I am making a skript that tracks a player when the compass is right clicked, and I am having trouble with the conditional in the skript.

Code (Text):
  1. command /track <player>:                                      
  2.   description: Use this command to track a player by right clicking with a compass
  3.   trigger:                                              
  4.     set {target player} to  arg 1                              
  5.     send "<yellow>You are tracking %{target player}%"              
  6.     give compass to the player
  7.  
  8. on rightclick with a compass:
  9.   if player and {targetplayer} is in world "world":                          
  10.     set {track location} to location of {target player}                          
  11.     set player's compass target to {track location}
  12.     send "<light green>Compass is now pointing to %{target player}%"
  13.   else if player is in world "world":
  14.     send "<light red>%{target player}%<light red> is not in the Overworld"
  15.   else:
  16.     send "<light red>The compass does not work in this dimension"

When I test the skirpt on my server, the game says *player name* is not in the Overworld, so clearly the first conditional is not including all the scenarios I want it to. When the compass is used in the other dimensions, the correct text appears, therefore (if I'm correct) the problem is line 9:
"if player and {targetplayer} is in world "world"
(this line is meant to check if both the tracked player and the player with the compass are in the overworld)
Any suggestions on what to change?

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