how do i target specific player

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

Status
Not open for further replies.

81dw

New Member
Dec 22, 2020
5
0
1
23
i have a command which says command /temspoo:

trigger:

op player

it works but i want it to target a specific player, is there any way to do that?
 
Hey 81dw,

How you would do this, is you would add a player argument to your command, so let's do as follows:
Code:
 command /temspoo <offline player>:
This will now allow you to do /tempspoo <player name>, an example is "/tempspoo 81dw."

Now we add the trigger of course:
Code:
command /temspoo <offline player>:
    trigger:
And now we have to make it op the specified player:
Code:
command /temspoo <offline player>:
    trigger:
        op arg 1
        send "&6You have made %arg 1% a server operator!"
I also added a message in there to make the command easier to use.

NOTE

In future please format your code so you can include indentations etc. to do this add [‎CODE] at the start of your code and [‎/CODE‎] at the end of your code.

MORE INFORMATION

For more information on constructing commands, you can follow this tutorial: Custom Commands - Skript Hub


I hope this helps!
 
If you wanna target a specific player you can use a argument:
Code:
command /op [<player>]:
    op arg-1

Hope I helped
 
If you wanna target a specific player you can use a argument:
Code:
command /op [<player>]:
    op arg-1

Hope I helped
You're missing trigger!! Use SkriptLearner's reply instead.
Hey 81dw,

How you would do this, is you would add a player argument to your command, so let's do as follows:
Code:
 command /temspoo <offline player>:
This will now allow you to do /tempspoo <player name>, an example is "/tempspoo 81dw."

Now we add the trigger of course:
Code:
command /temspoo <offline player>:
    trigger:
And now we have to make it op the specified player:
Code:
command /temspoo <offline player>:
    trigger:
        op arg 1
        send "&6You have made %arg 1% a server operator!"
I also added a message in there to make the command easier to use.

NOTE

In future please format your code so you can include indentations etc. to do this add [‎CODE] at the start of your code and [‎/CODE‎] at the end of your code.

MORE INFORMATION

For more information on constructing commands, you can follow this tutorial: Custom Commands - Skript Hub


I hope this helps!
 
I want it to target just 1 player, not where i have to choose the player i want it to automatically choose 1 player i put in the script. not having to type who i want to op in chat iw ant it to just auomatically op them. Specifically 1 player.
 
Last edited:
For the record, I'd recommend to add a system that makes it that only you can execute that command.
I've testted it so it should work.
Code:
command /opme:
  trigger:
    if player is not "YourMinecraftNameRightHere":
      send "&c&oYou are not ""YourMinecraftNameRightHere"" and therefore, you cannot execute this command."
    else:
      op player
      send "&a&oYou've made yourself a server operator! Once again, YOU RULE THE WORLD!"
      
on command "/deop YourMinecraftNameRightHere": # A SYSTEM TO PREVENT YOU FROM BEING GRIEFED
  cancel event
  send "&cNo no no no no i am not allowing you to grief boyyyyyyyyyyy"
i also added a system to prevent players from de-opping you. Just exempt yourself in the punishment plugin and you'll never get griefed.
 
Status
Not open for further replies.