#Wand

1 messages · Page 1 of 1 (latest)

royal briar
#
    if target entity is set:
        set {_target} to target entity
        set {_v} to vector from player to {_target}
        set vector length of {_v} to 0.7
        set {_loc} to location of player

        loop 200 times: 
            wait 1 tick
            
            set {_loc} to {_loc} ~ {_v}

            draw 1 dust_color_transition using dustTransition(red, orange, 10) at {_loc} with force

            if distance between {_loc} and {_target} <= 1:
                damage {_target} by 5
                stop
                
            if distance between {_loc} and player > distance between player and {_target}:
                stop
                
    else:
        set {_loc} to eye location of player
        set {_dir} to direction of player
        set vector length of {_dir} to 0.5

        set {_travelled} to 0

        loop 1000 times:
            wait 1 tick


        set {_loc} to {_loc} ~ {_dir}
        add 0.5 to {_travelled}


        draw 1 dust_color_transition using dustTransition(red, orange, 10) at {_loc} with force


        if {_travelled} >= 50:
            stop


        if block at {_loc} is solid:
            stop


        loop all living entities:
            if loop-entity is not player:
                if distance between {_loc} and loop-entity <= 1:
                    damage loop-entity by 5
                    stop```
#

I'm have trouble with the 2nd bit, after else

#

the line that says set {dir} is direction of player is giving me errors

#

and I cant figure out why

tall raft
#

Alternatively, you can get the player's yaw/pitch via: https://skripthub.net/docs/?id=934

royal briar
#

Thanks!