#How to make zombie spawn behind the player

1 messages · Page 1 of 1 (latest)

simple nexus
#

command /backstab:
    permission: skript.example.broadcast
    trigger:
        set {_playerLocation} to location of event-player
        set {_offsetVector} to vector -2, 0, 0  # Move 2 blocks backward on X-axis
        set {_spawnLocation} to {_playerLocation} add {_offsetVector}
        spawn a zombie at {_spawnLocation}
        
        # Play cave ambient sound at player's location
        play sound "AMBIENT_CAVE" at player's location```
#

It's not working properly and it will make the ambient cave sound but it wouldn't spawn the zombie behind the player that executed the command

alpine bough
#

add -> with offset

simple nexus
rancid lava
#

{_playerLocation} ~ {_offsetVector}

simple nexus
rancid lava
#

thats how you offset a location by a vector

simple nexus
#

in what line, sorry still learning

rancid lava
#

the line

alpine bough
#

line 6, iirc

simple nexus
alpine bough
#

you can't add a number to a location, that just doesn't make sense

alpine bough
#

you forgot the {} around your variable

simple nexus
alpine bough
#

and it's with offset, not just with

simple nexus
simple nexus