#Please someone explain to me this (very good title)

1 messages · Page 1 of 1 (latest)

formal coral
#

and its not specifically me

#

it happens to other people

#

even if they dont meet the conditions ofthe functions/events

scenic panther
#

Its a bug that happens if you die and get healed at the same time

formal coral
#

yet the same bug sitll applys

#

adn no i dont use the command (i should really change that) on them

#

or anything else

#

id sorta understand it bc im not checking if im alive on the on damage event (god this code is awful)

#

but im the only one who has "appa.skript"

#

im rewriting this but idk how id fix this bug

#

ok i found a fix

#

i think

#

maybe not bc i dont have another player i can test this with

#

checking if im the victim is alive for on damage fixes it for me atleast which should've been obvious

#

but

#

if this fixes it for other players

#

someone explain to me, why

#

how does it fix it for other players when they dont have the permission appa.skript

#

in lp, the default group has that permission set as false

#

only person who has it me

#

but yeah idk

#

shitty code if someone is wondering:

on left click:
    if player's tool is a spectral arrow named "&6&lHealing":
        if player has permission "appa.skript":
            set {_t} to player's targeted entity
            if {_t} is a player:
                healBeam(player)
            # Particles

local function healBeam(p: player):
    set {_loc} to location of {_p}'s eye location
    loop (distance between {_loc} and location of {_t}) / 0.1 times:
        set {_targetLoc} to location of {_t} ~ vector(0, 1.3, 0)
        set {_v} to vector from {_loc} to {_targetLoc}
        set vector length of {_v} to 0.8

        set {_loc} to {_loc} ~ {_v}
                
        draw 3 composter at {_loc} with offset vector(0.3, 0.3, 0.3) with force 

        if {_t} isn't alive:
            exit all loops

        loop entities in radius 1.5 of {_loc} where [input != {_p}]:
            heal {_t} by 1 hearts
            exit all loops # stops the projectile and runs code outside the loop
        wait 1 tick


on right click:
    if event-player has permission "skript.appa":
        if event-player's tool is a spectral arrow named "Healing":
            healSelf(player)
            cancel event


local function healSelf(p: player):
    
        #Particles
        draw 3 composter at location above {_p} with offset vector(0.3, 0.3, 0.3) with force 

        #Sound
        play sound "block.beacon.ambient" with volume 5 with pitch 1.2 at {_p}

        #Heal
        heal {_p} by 0.3 hearts

        wait 64 ticks


 #Eldwin Faster Regen

on damage of a player:
    if victim has permission "appa.skript":
        wait 2 ticks
        if victim is alive:
            heal victim by 1.5
#

idk i like my functions

#

idk will mark as solved