#how can i make this easier? or shorter

1 messages · Page 1 of 1 (latest)

solid walrus
#

it repeats the same thing but different locations and idk how to simplify it

patent sedge
# solid walrus it repeats the same thing but different locations and idk how to simplify it

you can make a function, which takes a string, like this:

local function spawnPig(respawn: string):
  spawn a big at {%{_respawn}%} # if you passed in "F", then the variable would be {F}.
  set name of spawned pig to "&dHog"
  add {_respawn} to string list tag "custom;Location"

if you would like, you could add in the function, to verify that the passed in string is valid input.

solid walrus
#

oh ty

#

also

#

oh wait

#

Line 2: starting a variables name with an expression is discouraged. you could prefix it with the scripts name: {animals::%{_respawn}%}

solid walrus
#

the line 2

patent sedge
solid walrus
#

alr but how can i do smth like:

{_string} = %string1% + "_" + %string2%```