Execute command per group on world enter

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Coolkc456

New Member
Sep 22, 2019
5
0
1
Skript Version: Skript bensku-2.4-beta7
Minecraft Version: 1.13.2
---
Full Code:
Code:
on join:
    if player is in "KnightCity":
        execute console command "warp KnightCity"
    else if player has permission "essentials.warps.barracks":
        execute console command "warp Barracks %player%"
Errors on Reload: None.

What I'd like Skript to do:
If a player logs out in the KnightCity world, I want them to be teleported to the KnightCity warp upon joining back in UNLESS they have the permission essentials.warps.barracks. If they have that permission, I want them to be warped to the Barracks. When players log back in, they're at the same point they left so I have this set to execute on join.

I want Skript to ignore players who log in at other worlds, regardless of their permissions.

What Skript is doing instead:
Skript successfully teleports people who are in KnightCity to the KnightCity warp, but it's doing that for ALL players, including players who have the essentials.warps.barracks permission.
Skript teleports people who have the permission essentials.warps.barracks to Barracks regardless of what world they are in instead of only doing it to players who have that permission AND are in KnightCity. I'm not sure how to get it to respect both conditions simultaneously. I don't want it to do one or the other.

Can anyone help me out? I'm 100% new to Skript. Thanks in advance.
 
Skript Version: Skript bensku-2.4-beta7
Minecraft Version: 1.13.2
---
Full Code:
Code:
on join:
    if player is in "KnightCity":
        execute console command "warp KnightCity"
    else if player has permission "essentials.warps.barracks":
        execute console command "warp Barracks %player%"
Errors on Reload: None.

What I'd like Skript to do:
If a player logs out in the KnightCity world, I want them to be teleported to the KnightCity warp upon joining back in UNLESS they have the permission essentials.warps.barracks. If they have that permission, I want them to be warped to the Barracks. When players log back in, they're at the same point they left so I have this set to execute on join.

I want Skript to ignore players who log in at other worlds, regardless of their permissions.

What Skript is doing instead:
Skript successfully teleports people who are in KnightCity to the KnightCity warp, but it's doing that for ALL players, including players who have the essentials.warps.barracks permission.
Skript teleports people who have the permission essentials.warps.barracks to Barracks regardless of what world they are in instead of only doing it to players who have that permission AND are in KnightCity. I'm not sure how to get it to respect both conditions simultaneously. I don't want it to do one or the other.

Can anyone help me out? I'm 100% new to Skript. Thanks in advance.
You will need to think about this logically:
- If the player in in KnightCity and they don't have the barracks permission, teleport them to KnightCity warp
- If the player is in KnightCity and the do have the barracks permission, teleport them to the barracks

So you will first have to check if they are in Knightcity. If they are in KnightCity, check if they have the barracks permission. If so, teleport them to the KnightCity warp, otherwise teleport them to the barracks.
 
You will need to think about this logically:
- If the player in in KnightCity and they don't have the barracks permission, teleport them to KnightCity warp
- If the player is in KnightCity and the do have the barracks permission, teleport them to the barracks

So you will first have to check if they are in Knightcity. If they are in KnightCity, check if they have the barracks permission. If so, teleport them to the KnightCity warp, otherwise teleport them to the barracks.
I don't know anything about Skript. How do I make the plugin check if they are in the KnightCity first before doing anything else? I already have it to check if they are in the KnightCity first.
 
I don't know anything about Skript. How do I make the plugin check if they are in the KnightCity first before doing anything else? I already have it to check if they are in the KnightCity first.
Well your code first checks if they're in KnightCity, and if so, warps them. Then it checks (if the first condition is false, AKA they're not in KnightCity) if they have the barracks permission, it executes the barracks command
 
Well your code first checks if they're in KnightCity, and if so, warps them. Then it checks (if the first condition is false, AKA they're not in KnightCity) if they have the barracks permission, it executes the barracks command
I know that. I don't know how to make it do what I want, though.
 
Status
Not open for further replies.