How to make a player run a 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.

Garamath

Member
Apr 3, 2021
4
0
1
23
Hi, I am trying to make a GUI to send a player to another world. My plan is to make the player send the command "/world [world]" as op. I have tried many codes, but none of them worked. Here is my code at the moment:

command /play:
trigger:
open virtual chest inventory with size 3 named "Select Game" to player
format gui slot 11 of player with diamond sword named "&9&lKIT PVP" to run:
make player run command "/world ul_FlatCopy" as op

And here is the error when I try to reload the script:
Can't understand this condition/effect: make player run command "/world ul_FlatCopy" as op (playgui.sk, line 5: make player run command "/world ul_FlatCopy" as op')

I have tried many of them like make player execute command, make player run cmd, but none of them works. I would really appreciate help. Thanks!
 
You need skUtilities to use as op. Why don't you just teleport the player to a location with teleport player to location(x, y, z, world "world")
 
You need skUtilities to use as op. Why don't you just teleport the player to a location with teleport player to location(x, y, z, world "world")
It says "Numeric ids are not supported anymore." now. What does it mean?
 
What is the skript that you used?
teleport player to location(x, y, z, world "world")

Full script:

command /play:
trigger:
open virtual chest inventory with size 3 named "Select Game" to player
format gui slot 11 of player with diamond sword named "&9&lKIT PVP" to run:
teleport player to location(0, 56, 0, world "ul_FlatCopy")
 
teleport player to location(x, y, z, world "world")

Full script:

command /play:
trigger:
open virtual chest inventory with size 3 named "Select Game" to player
format gui slot 11 of player with diamond sword named "&9&lKIT PVP" to run:
teleport player to location(0, 56, 0, world "ul_FlatCopy")

Try teleport player to location(0, 56, 0, world("ul_FlatCopy"))
 
Try teleport player to location(0, 56, 0, world("ul_FlatCopy"))
When I first tried to teleport, it teleported me to the same world that I was at the coordinates 0 56 0, but after it worked and teleported me to ul_FlatCopy. The script didn't make any errors, thank you!
 
I don't know what addon you are using for the GUI, but I will say Tuske is not great and has issues (similar story for SkQuery). Instead, I recommend a vanilla method such as this:
Code:
on inventory click:
  if uncolored name of event-inventory is "Select Game":
    if display name of event-item is "&9&lKIT PVP":
      cancel event
      teleport player to location(0, 56, 0, world("ul_FlatCopy"))
 
Status
Not open for further replies.