Solved make player execute command as op?

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

Denloself

Member
Oct 3, 2021
12
0
1
23
is there a way to make player execute command as op? (line 3 of the code)

Code:
on right click:
    if name of held item of the player is "&3test thingy":
        make player execute command "/skill+test %player%"
# i tried [make player execute command "/skill+test %player%" as op] but not working
        cancel event
      
command /skill+test <player>:
    permission: skript.thing
    cooldown: 1 seconds
    cooldown message: &fcooldown test&8: &a%remaining time%
    trigger:
        message "helo world" to the player
[doublepost=1636636730,1636629855][/doublepost]the problem solved by using addon "skUtilities"
 
is there a way to make player execute command as op? (line 3 of the code)

Code:
on right click:
    if name of held item of the player is "&3test thingy":
        make player execute command "/skill+test %player%"
# i tried [make player execute command "/skill+test %player%" as op] but not working
        cancel event
     
command /skill+test <player>:
    permission: skript.thing
    cooldown: 1 seconds
    cooldown message: &fcooldown test&8: &a%remaining time%
    trigger:
        message "helo world" to the player
[doublepost=1636636730,1636629855][/doublepost]the problem solved by using addon "skUtilities"
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
 
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
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:
on command:
    if player is op:
        if command is "[blanked1]" or "[blanked2]" or "wpcdfix":
            send "%player% used aa command lock" to console
        else:
            if {commandlock::%player%} or {commandlock::o} is 1:
                if {commandlock::%player%} is 1:
                    message "&7&o指令鎖為&a&o開啟," to the player
                else:
                    message "&7&o指令鎖為&9&o關閉,"
                if {commandlock::o} is 1:
                    message "&7&o外層指令鎖為&a&o開啟," to the player
                else:
                    message "&7&o外層指令鎖為&9&o關閉," to the player
                cancel event
        
command [blanked1]:
    permission: skript.thing
    trigger:
        if player is op:
            if {commandlock::%player%} is 1:
                set {commandlock::%player%} to 0
                message "%{commandlock::%player%}%" to the player
                message "&8''&7&olock off&8''" to the player
            else:
                set {commandlock::%player%} to 1
                message "%{commandlock::%player%}%" to the player
                message "&8''&7&olock on&8''" to the player
            
command [blanked2]:
    executable by: console
    trigger:
        if {commandlock::o} is 1:
            set {commandlock::o} to 0
            message "%{commandlock::o}%" to the player
            message "&8''&7&oOuterlock off&8''" to the player
        else:
            set {commandlock::o} to 1
            message "%{commandlock::o}%" to the player
            message "&8''&7&oOuterlock on&8''" to the player
(i blanked the actual command here)
 
Status
Not open for further replies.