#cannot use variables in location At espression

1 messages · Page 1 of 1 (latest)

cold warren
#
    set {claimX} to x-coordinate of event-block
    set {claimY} to y-coordinate of event-block 
    set {claimZ} to z-coordinate of event-block
    set {claimX} to {claimX} + 4
    set {claimZ} to {claimZ} - 4
    set block at ({claimX}, {claimY}, {claimZ}, world "world") to {claimblock::%player's uuid%}```
deft garnet
#

location function

#

but please either just use the expressions or local vars

#

you dont need vars, much less global ones

cold warren
#

just an example

deft garnet
#
  set {victim} to victim
  broadcast "%{victim}% died!"
#here we set a global variable, which persists and takes up storage.

on death:
  set {_victim} to victim
  broadcast "%{_victim}% died!"
#this is better, now the variable will be automatically deleted

on death:
  broadcast "%victim% died!"
#this is best, we dont even have to worry about the variable and we save a line``` so you would want `block at location(x-coord, y-corrd, z-coord, world)`