There's no player in a function event(run cmd by 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 community!

    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.

dorazimuchim

New Member
Mar 7, 2020
5
0
0
Skript Version : Skript 2.5 (alpha1)
Minecraft Version: 1.15.2
Code:
function runParticleRGB(l:location,r:number,g:number,b:number):
    loop "r", "g" and "b":
        {_%loop-value%} is not between 0.01 and 1
        send "[Ai_CommandFx] runParticleRGB() = {_%loop-value%} is Invalid parameter" to console
        set {_s} to true
    {_s} is not set
    set {_l::*} to x-coord of {_l}, y-coord of {_l} and z-coord of {_l}
    execute command "/particle dust %{_r}% %{_g}% %{_b}% 4 %{_l::1}% %{_l::2}% %{_l::3}% 1 0 0 1 1 force @a" by op
It says "There's no player in a function event" and doesn't work.
Can you help me to solve this problem?

I also tried "execute command "/asdf" by console, and it worked. but the console messages are so disturbing to play that I want the OP to run.
 
Skript Version : Skript 2.5 (alpha1)
Minecraft Version: 1.15.2
Code:
function runParticleRGB(l:location,r:number,g:number,b:number):
    loop "r", "g" and "b":
        {_%loop-value%} is not between 0.01 and 1
        send "[Ai_CommandFx] runParticleRGB() = {_%loop-value%} is Invalid parameter" to console
        set {_s} to true
    {_s} is not set
    set {_l::*} to x-coord of {_l}, y-coord of {_l} and z-coord of {_l}
    execute command "/particle dust %{_r}% %{_g}% %{_b}% 4 %{_l::1}% %{_l::2}% %{_l::3}% 1 0 0 1 1 force @a" by op
It says "There's no player in a function event" and doesn't work.
Can you help me to solve this problem?

I also tried "execute command "/asdf" by console, and it worked. but the console messages are so disturbing to play that I want the OP to run.
What OP do you want it to run?
 
Ok, so which player should be running the command exactly?
exactly, I'm making signcasinoslot machine and want to show particles to jackpot player. but the player who is not OP can't run command /particle command, so I'm trying to run command by permmision OP
 
exactly, I'm making signcasinoslot machine and want to show particles to jackpot player. but the player who is not OP can't run command /particle command, so I'm trying to run command by permmision OP
You should probably use visual effects to display particles (if vanilla Skript doesn't provide enough functionality, take a look at skDragon).
If all of that doesn't do it for you, you can use this, which essentially gives a player OP, makes them run the command and removes their OP again. You can simply do this in Skript with op/deop, but this isn't the safest way of doing things.
 
Status
Not open for further replies.