click event to make console execute command

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

Rivenze

Member
Feb 2, 2018
22
0
0
23
hey! i have this code that opens a book:
code_language.skript:
command /rank:
    trigger:
        set {_book} to a new book
        wait 1 tick
        set {_component} to a new text component with "&3Click on one of the &3ranks below to &3disguise your rank. &cNote that all &cpermissions from your &crank will be removed &cand you will be given &cthe permissions of the &crank you chose."
        wait 1 tick
        set {_component2} to a new text component with "%nl%%nl%&7Member"
        wait 1 tick
        add hover event with action SHOW_TEXT with text "&3Your rank will be disguised as &7Member&3." to text component {_component2}
        wait 1 tick
        add click event with action RUN_COMMAND with execute "/setrank %player% Member" to text component {_component2}
                add click event with action RUN_COMMAND with execute "/alert Hello" to text component {_component2}
        add text component {_component} and {_component2} to book {_book}
        wait 2 tick
        open book {_book}  to player

however where it says "add click event with action RUN_COMMAND with execute" that is making the player run the command, how do i make it so that it adds a click event that makes the CONSOLE execute the command?
 
Just make a command to execute that command from the console, like this:
code_language.skript:
command bookcmdnooneshouldknowabout:
  trigger:
    make console execute command "setrank %player% Member"
This is kinda dangerous though, as it is just the member rank it shouldn't be a problem but still. I'd add a permission to the player when they execute the /rank command, and then remove it when /bookcmdnooneshouldknowabout is executed.
 
Status
Not open for further replies.