Compare player's team.

  • 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 comminuty!

    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!

Kesballo

Member
Nov 28, 2024
1
0
1
20
Hi! I need help with comparing the player's team to a team in a custom command with Skript. this is the command so far but i don't see any method to comparing a team. Any help would be accepted!

Code:

code_language.skript:
command /pro:
    description: Teleports the player if its team is not "Noob"
    trigger:
        if %team of player% is not "Noob":
            execute console command "tp %player% 1 1 1"
            send "&aYou have been teleported to Pro Level!" to player
        else:
            send "&cYou are a Noob! You cannot use this command." to player
 
Hi! I need help with comparing the player's team to a team in a custom command with Skript. this is the command so far but i don't see any method to comparing a team. Any help would be accepted!

Code:

code_language.skript:
command /pro:
    description: Teleports the player if its team is not "Noob"
    trigger:
        if %team of player% is not "Noob":
            execute console command "tp %player% 1 1 1"
            send "&aYou have been teleported to Pro Level!" to player
        else:
            send "&cYou are a Noob! You cannot use this command." to player
Firstly, only use percents around expressions when they are in text. Ie: send "%player%" to player.
Also, there is this expression https://skripthub.net/docs/?id=4488. As long as you have an expression like that, you don't need anything extra fancy to compare it. So replace %team of player% with: player's team and you shouldn't have any issues.