Solved Skript help - If player name is, then...

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

CustomWorldYT

Member
Jun 17, 2018
15
0
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_language.skript:
on place of command_block:
        if name of player is CustomWorldYT, Admin or Admin2: #I nedd the condition right there
            message "&cOK." to player #its ok when admin places command block
        else:
                message "&cOnly admins can use command blocks." to player #regular ops cant place cmd blocks
                cancel event #...so lets block the placement of cmd blocks

Errors on Reload:

code_language.skript:
Not very specific errors, I want to find a condition "when player name is, then..." (or isn't)... details above...

Console Errors:

code_language.skript:
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.
 
name of player is string so you have to use: "NickName128"
code_language.skript:
on place of command_block:
        if name of player is "CustomWorldYT", "Admin" or "Admin2": #I nedd the condition right there
            send "&cOK." to player #its ok when admin places command block
        else:
                send "&cOnly admins can use command blocks." to player #regular ops cant place cmd blocks
                cancel event #...so lets block the placement of cmd blocks
so make it like this:

code_language.skript:
on place of command_block:
        if name of player is not "CustomWorldYT", "Admin" or "Admin2": #I nedd the condition right there
            send "&cOnly admins can use command blocks." to player #regular ops cant place cmd blocks
            cancel event #...so lets block the placement of cmd blocks
code_language.skript:
on command:
    if command is "stop", "pex" or "reload"
        if name of player is not "Admin1" or "Admin2":
            cancel event
            send "&cNot now... Sorry" to player
 
Last edited:
  • Like
Reactions: CustomWorldYT
Such fix.
Much reply.
Very thx!
WOW!

such-problem-much-fix-very-tech-such-support-wow-2737205.png


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