Solved Set Specific Usernames

  • 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.
May 11, 2022
11
1
3
23
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
 
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:
command /example:
    permission: #permission goes here
    permission message: &cYou don't have permission to use this command
    trigger:
        #code
 
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:
command /example:
    permission: #permission goes here
    permission message: &cYou don't have permission to use this command
    trigger:
        #code

Would I have to make a different permission for each person that I want to add to my server?
 
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.
 
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.
Code:
Command /test [<player>]:
    Trigger:
        If arg 1 is "Mich7272":
            Set player's max health to 20
 
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
 
Last edited:
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
I have an idea
Code:
On load:
    Set {list::1} to ElementAstronaut

Now you can do stuff like
Set {list::1}'s max health to 10
Kill {list::1}
 
I have an idea
Code:
On load:
    Set {list::1} to ElementAstronaut

Now you can do stuff like
Set {list::1}'s max health to 10
Kill {list::1}

Whenever I try to do the code
Code:
on load:
   set {list::1} to ElementAstronaut

I get the error message saying "Can't understand this condition/ effect: set {list::1} to ElementAstronaut"
 
Whenever I try to do the code
Code:
On load:
   set {list::1} to ElementAstronaut

I get the error message saying "Can't understand this condition/ effect: set {list::1} to ElementAstronaut"
Do this instead
Command /test:
Trigger:
Set {list::1} to player
Just you execute this command then delete it
 
Do this instead
Command /test:
Trigger:
Set {list::1} to player
Just you execute this command then delete it

I had to change it just a bit so that it now says

Code:
command /arg:
    trigger:
        set {list::1} to "ElementAstronaut" parsed as offline player

But it works now, thank you so much!
 
  • Like
Reactions: Mich
Status
Not open for further replies.