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 make player execute command as op?

Discussion in 'Skript' started by Denloself, Nov 11, 2021.

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

    Denloself New Member

    Joined:
    Oct 3, 2021
    Messages:
    9
    Likes Received:
    0
    is there a way to make player execute command as op? (line 3 of the code)

    Code (Text):
    1. on right click:
    2.     if name of held item of the player is "&3test thingy":
    3.         make player execute command "/skill+test %player%"
    4. # i tried [make player execute command "/skill+test %player%" as op] but not working
    5.         cancel event
    6.      
    7. command /skill+test <player>:
    8.     permission: skript.thing
    9.     cooldown: 1 seconds
    10.     cooldown message: &fcooldown test&8: &a%remaining time%
    11.     trigger:
    12.         message "helo world" to the player
    --- Double Post Merged, Nov 11, 2021, Original Post Date: Nov 11, 2021 ---
    the problem solved by using addon "skUtilities"
     
  2. oToghty

    VIP Supporter +

    Joined:
    Sep 1, 2020
    Messages:
    143
    Likes Received:
    5
    that is the worst option you could have taken, the addon is very outdated and on top of that, running a commad as op does actually give op to the player for a split second, meaning that there's a chance they remain with op
     
  3. Denloself

    Denloself New Member

    Joined:
    Oct 3, 2021
    Messages:
    9
    Likes Received:
    0
    oh, i have a command lock (it will lock player who have op permission, if you want to use command, you have to unlock it) to prevent something wrong happen

    oh and if you wonder, the code look like this
    Code (Text):
    1. on command:
    2.     if player is op:
    3.         if command is "[blanked1]" or "[blanked2]" or "wpcdfix":
    4.             send "%player% used aa command lock" to console
    5.         else:
    6.             if {commandlock::%player%} or {commandlock::o} is 1:
    7.                 if {commandlock::%player%} is 1:
    8.                     message "&7&o指令鎖為&a&o開啟," to the player
    9.                 else:
    10.                     message "&7&o指令鎖為&9&o關閉,"
    11.                 if {commandlock::o} is 1:
    12.                     message "&7&o外層指令鎖為&a&o開啟," to the player
    13.                 else:
    14.                     message "&7&o外層指令鎖為&9&o關閉," to the player
    15.                 cancel event
    16.        
    17. command [blanked1]:
    18.     permission: skript.thing
    19.     trigger:
    20.         if player is op:
    21.             if {commandlock::%player%} is 1:
    22.                 set {commandlock::%player%} to 0
    23.                 message "%{commandlock::%player%}%" to the player
    24.                 message "&8''&7&olock off&8''" to the player
    25.             else:
    26.                 set {commandlock::%player%} to 1
    27.                 message "%{commandlock::%player%}%" to the player
    28.                 message "&8''&7&olock on&8''" to the player
    29.            
    30. command [blanked2]:
    31.     executable by: console
    32.     trigger:
    33.         if {commandlock::o} is 1:
    34.             set {commandlock::o} to 0
    35.             message "%{commandlock::o}%" to the player
    36.             message "&8''&7&oOuterlock off&8''" to the player
    37.         else:
    38.             set {commandlock::o} to 1
    39.             message "%{commandlock::o}%" to the player
    40.             message "&8''&7&oOuterlock on&8''" to the player
    (i blanked the actual command here)
     
Thread Status:
Not open for further replies.

Share This Page

Loading...