#subtract from location

1 messages · Page 1 of 1 (latest)

round rampart
#

I am trying to subtract from players location but cant figure it out. Any help would be appreciated.

CURRENT SKRIPT:
command /particleeffect:
trigger:
set {y_loc.%player%} to y-coordinate of player
set {x_loc.%player%} to x-coordinate of player-1
set {z_loc.%player%} to z-coordinate of player
show mob spawner flames at {x_loc.%player%} {y_loc.%player%} {z_loc.%player%}

placid saffron
#

have u tried set {x_loc.%player%} to (x coordinate of player) - 1

round rampart
#

Yeah

#

It just doesn’t put it there

#

I even tried it without subtracting and it didn’t put the particle

placid saffron
#

wait

#

the last line

#

show mob spawner flames at location( )

#
command /particleeffect:
    trigger:
        set {y_loc.%player%} to y-coordinate of player
        set {x_loc.%player%} to x-coordinate of player-1
        set {z_loc.%player%} to z-coordinate of player
        show mob spawner flames at location({x_loc.%player%}, {y_loc.%player%}, {z_loc.%player%})```
abstract kettle
abstract kettle
# round rampart I am trying to subtract from players location but cant figure it out. Any help ...
  1. Use code blocks to make your code and indentation readable
  • ```code here```
  1. those variables are going to persist after this runs and take up storage space. you should make them local variables, or use vectors:
lerp 0 of flame at block below {_location}

lerp 0 of flame at (player's location ~ vector(0, -1, 0))```
3. dont use `.` in variable names for a spacer, use `::`, which has a lot more functionality
placid saffron
placid saffron
#

That's would i would call quality code

abstract kettle
glossy island
#

skbee particle syntax is infinitely better than the vanilla one

cyan salmon
#

RaGe grim is the particle god

#

RuneBlade weapons 😎😎😎

round rampart
abstract kettle
#

Yes. My point was that it “works better” for a simple description

round rampart
#

alr

round rampart
abstract kettle
#

the parameters in the vectors are for the x/y/z

round rampart
#

yes

#

lerp 0 of flame at block below {_location}

abstract kettle
#
set {_v}'s yaw to {_v}'s yaw + 90 #now "right"```
#

or you can do n left of (entity)

round rampart
#

I have this

    trigger:
        if {purpleon::%player%} is not set:
            set {purpleon::%player%} to true
            send "Purple particles are now on." to player
        else if {purpleon::%player%} is true:
            set {purpleon::%player%} to false
            send "Purple particles are now off." to player
        else:
            set {purpleon::%player%} to true
            send "Purple particles are now on." to player

every tick:
    loop all players:
        if {purpleon::%loop-player%} is true:
            set {_location} to location of loop-player
            set {_v} to vector from yaw loop-player's yaw and pitch loop-player's pitch
            set {_v}'s yaw to {_v}'s yaw + 90 
            lerp 1 of flame at {_location} offset by {_v}

but I cant figure out how to make it 2 blocks to the left and 1 up

round rampart
#

I fixed the height but I cant get it to go 1 left or 1 right

    trigger:
        if {purpleon::%player%} is not set:
            set {purpleon::%player%} to true
            send "Purple particles are now on." to player
        else if {purpleon::%player%} is true:
            set {purpleon::%player%} to false
            send "Purple particles are now off." to player
        else:
            set {purpleon::%player%} to true
            send "Purple particles are now on." to player

every tick:
    loop all players:
        if {purpleon::%loop-player%} is true:
            set {_location} to location of loop-player's head
            set {_v} to vector from yaw loop-player's yaw and pitch loop-player's pitch
            set {_v}'s yaw to {_v}'s yaw + 90 
            set {_v2} to vector from yaw loop-player's yaw and pitch loop-player's pitch
            set {_v2}'s yaw to {_v}'s yaw - 180
            set {_v2}'s pitch to 0
            set {_v}'s pitch to 0
            lerp 0 of flame at {_location} offset by {_v}
            lerp 0 of flame at {_location} offset by {_v2}```
abstract kettle
#

nonononnnononono

#

do NOT loop all players for this

#

thats a lag machine

#

you can delete the variables to save storage, as even when they are set to false they are still set and take up storage.

#

also use UUIDs

#

im not sure what this variable is for, but if you dont need it to persist over a restart you should use metadata

round rampart
abstract kettle
#

looping all players every tick? it absolutely will lag. maybe you dont notice if its only you on the server, but it is far from desireable in any situation

round rampart
#

so what should I do?

#

im a bit sped

abstract kettle
#

put the code in the while loop

#

dont forget to wait

#

id say wait a second

round rampart
#

im so confused rn

abstract kettle
#
  broadcast "math still works!"
  wait 1 second```
#

that will continuosly run while the condition passes