#Function Error

1 messages · Page 1 of 1 (latest)

tepid bluff
#

function lazer(p: player):
loop all blocks infront of {_p}:
if loop-block is air:
draw 10 of dust using dustOption(rgb(0, 255, 0), 1) at loop-block
if loop-block is not air:
push {_p} in direction of {_p} at speed 2
push {_p} up at speed 1
wait 1 ticks
play sound "minecraft:entity.fishing_bobber.throw" with volume 5 from the loop-block
stop

#

idk how to use function

#

i am still learning

#

but idk what's the issue

random osprey
#
#

As you can see the playsound effect takes a player at the end. When you dont give it a player it tries to get one from the trigger but as the error says, the function does not have a player. You have to add to {_p} at the end so it know who to play the sound to. Alternatively you could also play it to all players

tepid bluff
#

oh ok