#loops/selecting player

1 messages · Page 1 of 1 (latest)

neon willow
#

Hey! Currently when i use the zeus item it will give all the players with "poseidon" the pufferfish item instead of just the person who used the zeus item
How do i make it so that its only the player using the zeus item that gets the pufferfish?

    if name of event-item is "&eZeus's Blessing":
        if {god::%player%} is not "zeus":
            itemuse(player)
            set {god::%player%} to "zeus"
            send "&e§lZeus decided to lend you his blessing." to event-player
            remove 1 of event-item from event-player
            thunderparticle(event-player)
            while {god::%player%} is "zeus":
                zeus(player)
                wait 3 ticks```
#
    set {_puffer} to shears named "&3Poseidon's Blessing"
    set item model of {_puffer} to "minecraft:pufferfish"
    give {_p} {_puffer}

function itemuse(p: player):
    loop all players:
        if {god::%loop-player%} is "poseidon":
            pufferfish(loop-player)```
#

(Im aware its cause of "loop all players" but im not sure how to change it, i tried loop {_p} but it just gave me an error instead

vagrant osprey
#

so if you are zeus

#

you get poseidon's blessing?

#

p is literally player

#
  if {god::%{_p}'s uuid%} is "poseidon":
    pufferfish({_p})```
neon willow
cunning egret
#

is there a reason you're not doing pufferfish({_p})

neon willow
cunning egret
#

send the code u tried, bc it should just be {god::%{_p}%}

neon willow