Need some clarification on variables in blockdata

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

xTomCat

Member
Aug 29, 2023
1
0
1
I'm pretty new to skript, i have an issue that essentially boils down to this. I don't seem to be able to use variables in blockdata. Here's my skript, am i doing something wrong?
```
command /ametest:
trigger:
set {_a} to "south"
set block at player's location to amethyst_cluster[facing={_a}]
```
 
On second thought, no research needed. I see your error. If you want to use variables in triggers or events, you have to use "%" around the variable. For example, %{_a}%. Your code would look something like this:

Code:
command /ametest:
    trigger:
        set {_a} to "south"
        set block at player's location to amethyst_cluster[facing=%{_a}%]

Let me know if you still have issues, and I'll try to help you.