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

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Set Specific Usernames

Discussion in 'Skript' started by ElementAstronaut, May 12, 2022.

  1. ElementAstronaut

    Joined:
    May 11, 2022
    Messages:
    10
    Likes Received:
    1
    I'd like to set up a command so that it will only affect my own username, not whoever clicks it, my current command doesn't work correctly though. Command:

    set ElementAstronaut's max health to 10

    The error that I get in chat however shows up as;

    Can't understand this condition/effect: set ElementAstronaut's max health to 10
     
  2. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    it doesn't understand what "elementastronaut" is
    instead, check if the player that is using the command has a specific permission (or, if you are the only player who has /op perms, you can check if the player has permission "op") and if they do, set the max health to that.
    So if you are using a command, something in the form of this:
    Code (Text):
    1. command /example:
    2.     permission: #permission goes here
    3.     permission message: &cYou don't have permission to use this command
    4.     trigger:
    5.         #code
     
  3. ElementAstronaut

    Joined:
    May 11, 2022
    Messages:
    10
    Likes Received:
    1
    Would I have to make a different permission for each person that I want to add to my server?
     
  4. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    No you can just give them the same permission and it will apply to them too
     
  5. ElementAstronaut

    Joined:
    May 11, 2022
    Messages:
    10
    Likes Received:
    1
    Is there more of a like "if name of player is" type of command? Because I'm not sure if there is a way to implement the other way in with my commanding currently.
     
  6. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    141
    Likes Received:
    5
    Code (Text):
    1. Command /test [<player>]:
    2.     Trigger:
    3.         If arg 1 is "Mich7272":
    4.             Set player's max health to 20
     
  7. ElementAstronaut

    Joined:
    May 11, 2022
    Messages:
    10
    Likes Received:
    1
    I'm not creating a /command, so arg-1 wouldn't work, would there be a way to specify with this command that I made? By the way, I'm trying to make it so that anytime that anybody on the server clicks it, it will affect me. (Red letters is the part of the name that I want to specify)

    on inventory click:
    if inventory name of player's current inventory is "&b&lRevive Menu":
    cancel event
    clicked slot is 9:
    set ElementAstronaut's max health to 10
    close player's inventory
    loop all players:
    send title "&4&lElementAstronaut &e&lHas" with subtitle "&e&lBeen &b&lRevived!" to player for 5 seconds
    play sound "block.note_block.chime" at volume 10 at pitch 1 to player
    play sound "block.note_block.chime" at volume 10 at pitch 1 to player
    play sound "block.note_block.chime" at volume 10 at pitch 2 to player
    play sound "block.note_block.chime" at volume 10 at pitch 3 to player
     
    #7 ElementAstronaut, May 14, 2022
    Last edited: May 14, 2022
  8. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    141
    Likes Received:
    5
    I have an idea
    Code (Text):
    1. On load:
    2.     Set {list::1} to ElementAstronaut
    3.  
    4. Now you can do stuff like
    5. Set {list::1}'s max health to 10
    6. Kill {list::1}
    7.  
     
  9. ElementAstronaut

    Joined:
    May 11, 2022
    Messages:
    10
    Likes Received:
    1
    Whenever I try to do the code
    Code (Text):
    1. on load:
    2.    set {list::1} to ElementAstronaut
    I get the error message saying "Can't understand this condition/ effect: set {list::1} to ElementAstronaut"
     
  10. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    141
    Likes Received:
    5
    Do this instead
    Command /test:
    Trigger:
    Set {list::1} to player
    Just you execute this command then delete it
     
  11. ElementAstronaut

    Joined:
    May 11, 2022
    Messages:
    10
    Likes Received:
    1
    I had to change it just a bit so that it now says

    Code (Text):
    1. command /arg:
    2.     trigger:
    3.         set {list::1} to "ElementAstronaut" parsed as offline player
    But it works now, thank you so much!
     
    • Like Like x 1

Share This Page

Loading...