#So im trying to make a skript where when you splash a potion it executes a command but it doesnt it?

1 messages · Page 1 of 1 (latest)

viscid grotto
#

So im trying to make a skript where when you splash a potion it executes a command but it doesnt it work. No errors btw

on damage: if event-entity is a player: set {_cause} to cause of event if {_cause} is a potion: set {_potion} to {_cause}'s type's display name if {_potion} is "Good Potion": execute console command "infuse-effect-reset %victim%" execute console command "effect clear %victim%"

elder reef
viscid grotto
#

What else would i use? new to this sorry

elder reef
viscid grotto
#

While throwing

elder reef
elder reef
#

Ok give me a second

#
 if name of event-item is "magical potion":
  execute command "say hey"```
elder reef
#

@viscid grotto did this work?

lucid terrace
#

on trow thumbsUp

elder reef
#

Yeah my bad 😅

viscid grotto
#

Oh sorry my bad I was away from my ox gotta try it tmrw

viscid grotto
elder reef
viscid grotto
#

Its alright ill figure it out

elder reef
#

on consume will work

on consume of potion:
 if name of event-item is "magical potion":
  execute command "say hey"```
#

@viscid grotto ^

viscid grotto
#

Trying it rn

elder reef
#

Alr

viscid grotto
#

IT WORKEDD!!!!!

#

Thank you so much

#

My bad last question how do run one command as op

viscid grotto
#

So like one of the commands cant be run thru console

#

the player has to run it

#

im trying to figure how to run the command thru op or temp give them the perm

elder reef
#

Like make player execute command ""

#

This will only work for players having the commands perms

#

You could also use execute console command "execute at/as %player% run (your command)" if you want it to run though console

viscid grotto
#

So like this

execute console command "execute at/as %player% run infuse-effect-reset %player%"

elder reef
#

Because at/as are 2 different things

viscid grotto
#

Im trying to reset the players effect

#

Its called infuse

elder reef
#

Then just use execute console command "infuse-effect-reset %player%"

viscid grotto
#

yea thats the problem it wont work as console

#

Only as a player op or with perm

elder reef
#

Ohhh

elder reef
viscid grotto
#

Is there any way to give the player the permission real quick and just take it away

elder reef
viscid grotto
viscid grotto
elder reef
#

Of the command

viscid grotto
#

Ye

elder reef
#

Omg I’m going insane with you

#

/execute as <targets> <secondExecuteCommand>

viscid grotto
viscid grotto
elder reef
viscid grotto
elder reef
#

Run

#

Then your command

viscid grotto
#

But the command im trying to run is a skript command 😮

elder reef
#

Omg

#

Why dont you just implement the code for the thing it’s supposed to do instead of running a separate command??

viscid grotto
#

The code is massive

elder reef
viscid grotto
elder reef
# viscid grotto
    if name of event-item is "&c&lGood Potion":
            if {effect::%uuid of player%::*} is set:
                delete {effect::%uuid of player%::*}
                removeEffects(player)
#

Implement this

viscid grotto
#

on consume of potion: if name of event-item is "&c&lGood Potion": trigger: if {effect::%uuid of player%::} is set: delete {effect::%uuid of player%::} removeEffects(player)

#

Like thta

elder reef
#

Also add this


function removeEffects(p: player):

    remove strength from potion effects of {_p}
    remove speed from potion effects of {_p}
    remove fire resistance from potion effects of {_p}
    remove health boost from potion effects of {_p}
    remove dolphins grace from potion effects of {_p}
    remove haste from potion effects of {_p}
    remove water breathing from potion effects of {_p}
    remove luck from potion effects of {_p}
    remove saturation from potion effects of {_p}
    
    remove mining fatigue from potion effects of {_p}
    remove jump boost from potion effects of {_p}
    remove slow falling from potion effects of {_p}
    remove hunger from potion effects of {_p}
    remove bad luck from potion effects of {_p}``` into the code
#

Just this separated

#

If you code it inside the other plugin then you do not have to code it

viscid grotto
elder reef
#
    if name of event-item is "&c&lGood Potion":
            if {effect::%uuid of player%::*} is set:
                delete {effect::%uuid of player%::*}
                removeEffects(player)


function removeEffects(p: player):

    remove strength from potion effects of {_p}
    remove speed from potion effects of {_p}
    remove fire resistance from potion effects of {_p}
    remove health boost from potion effects of {_p}
    remove dolphins grace from potion effects of {_p}
    remove haste from potion effects of {_p}
    remove water breathing from potion effects of {_p}
    remove luck from potion effects of {_p}
    remove saturation from potion effects of {_p}
    
    remove mining fatigue from potion effects of {_p}
    remove jump boost from potion effects of {_p}
    remove slow falling from potion effects of {_p}
    remove hunger from potion effects of {_p}
    remove bad luck from potion effects of {_p}

#

This should work I suppose

viscid grotto
#

i really hate skript

elder reef
viscid grotto
#

on consume of potion: if name of event-item is "&c&lGood Potion": trigger: if {effect::%uuid of player%::*} is set: delete {effect::%uuid of player%::*} removeEffects(player)

elder reef
#

Mate….

viscid grotto
#

Now i tried this

on consume of potion: if name of event-item is "&c&lGood Potion": if {effect::%uuid of player%::*} is set: delete {effect::%uuid of player%::} removeEffects(player)

elder reef
#

Don’t use trigger

viscid grotto
#

Ye i tried that now i get this

elder reef
#

Trigger is only for commands

viscid grotto
elder reef
viscid grotto
#

on consume of potion: if name of event-item is "&c&lGood Potion": if {effect::%uuid of player%::*} is set: delete {effect uuid of %player%} removeEffects(player)

elder reef
#

Nooo 😭😭

#
    if name of event-item is "&c&lGood Potion":
            if {effect::%uuid of player%::*} is set:
                delete {effect::%uuid of player%::*}
                removeEffects(player)
viscid grotto
#

It woorks s

#

FINNALLLY

#

only 3 years later

#

thank you so much