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 Skript help - If player name is, then...

Discussion in 'Skript' started by CustomWorldYT, Jun 18, 2018.

Thread Status:
Not open for further replies.
  1. CustomWorldYT

    CustomWorldYT Member

    Joined:
    Jun 17, 2018
    Messages:
    15
    Likes Received:
    0
    I have recently started to "code" in Skript because I don't know Java. I'm going to code a FreeOP mod for my server, I don't want to use original mod from <some free op server you probably know> because I think that I can do it in Skript. FreeOP servers (if you don't know) are servers when players are given limited OP status. They are forbiden to use commands like /stop etc. Now I want to make staff ranks and I have problem: I need a condition to allow players with specific username to edit or place command blocks, run blocked commands etc... I can't use permissions because everyone has just OP (* permission). I tired to search docs and forums using search engines but I found nothing that could help me.
    I'm not using any addons so my question is: Is there a condition like "if player name is Admin1 or Admin2, then do this, do that, else do this there blah blah... Is any addon that can do this, or is there even any alternative way how to make it using variables etc...???

    Skript Version: dev36 (Pre-release)
    Skript Author: CustomWorldYT
    Minecraft Version: 1.12.2

    ---
    Problem thingy:

    Code (Skript):
    1.  
    2. on place of command_block:
    3.         if name of player is CustomWorldYT, Admin or Admin2: #I nedd the condition right there
    4.             message "&cOK." to player #its ok when admin places command block
    5.         else:
    6.                 message "&cOnly admins can use command blocks." to player #regular ops cant place cmd blocks
    7.                 cancel event #...so lets block the placement of cmd blocks
    8.  
    Errors on Reload:

    Code (Skript):
    1. Not very specific errors, I want to find a condition "when player name is, then..." (or isn't)... details above...
    Console Errors:

    Code (Skript):
    1. None...
    Other Useful Info:

    Addons using (including versions):
    None currently...

    Troubleshooting:

    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes
    What other methods have you tried to fix it?
    I tired to set many different conditions, like "if player's name is" or "if player name equals"... Rest of problem is explained above.
     
  2. Best Answer:
    Post #2 by MusicManSK, Jun 18, 2018
  3. MusicManSK

    MusicManSK Active Member

    Joined:
    Nov 30, 2017
    Messages:
    232
    Likes Received:
    11
    name of player is string so you have to use: "NickName128"
    Code (Skript):
    1. on place of command_block:
    2.         if name of player is "CustomWorldYT", "Admin" or "Admin2": #I nedd the condition right there
    3.             send "&cOK." to player #its ok when admin places command block
    4.         else:
    5.                 send "&cOnly admins can use command blocks." to player #regular ops cant place cmd blocks
    6.                 cancel event #...so lets block the placement of cmd blocks
    so make it like this:

    Code (Skript):
    1. on place of command_block:
    2.         if name of player is not "CustomWorldYT", "Admin" or "Admin2": #I nedd the condition right there
    3.             send "&cOnly admins can use command blocks." to player #regular ops cant place cmd blocks
    4.             cancel event #...so lets block the placement of cmd blocks
    Code (Skript):
    1. on command:
    2.     if command is "stop", "pex" or "reload"
    3.         if name of player is not "Admin1" or "Admin2":
    4.             cancel event
    5.             send "&cNot now... Sorry" to player
     
    #2 MusicManSK, Jun 18, 2018
    Last edited: Jun 18, 2018
    • Like Like x 1
  4. CustomWorldYT

    CustomWorldYT Member

    Joined:
    Jun 17, 2018
    Messages:
    15
    Likes Received:
    0
    Such fix.
    Much reply.
    Very thx!
    WOW!

    [​IMG]

    OK just thx you very much, it worked!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...