On place of a modifiable list of blocks

  • 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 comminuty!

    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!

Status
Not open for further replies.

Zyhriz

Member
Jun 20, 2020
1
0
0
20
Skript Version: Skript 2.4.1-MH
Minecraft Version: 1.15
Problematic code:
Code:
on block place:
    set event-block to {_event-block}
    if {builderReq} contains {_event-block}:
        add 1 to {builder.%player%}
        broadcast "[debug] li1"
    else:
        broadcast "[debug] li2"
         # Constantly broadcasts li2
        stop
The code will constantly broadcast "[debug] li2" instead of "[debug] li1"
My main goal is to have {builderReq} to be changeable via command. If anyone could help out that'd be great.
Edit: Forgot to mention. I've checked forum posts and I've checked multiple wikis. None seem to help out.
 
Skript Version: Skript 2.4.1-MH
Minecraft Version: 1.15
Problematic code:
Code:
on block place:
    set event-block to {_event-block}
    if {builderReq} contains {_event-block}:
        add 1 to {builder.%player%}
        broadcast "[debug] li1"
    else:
        broadcast "[debug] li2"
         # Constantly broadcasts li2
        stop
The code will constantly broadcast "[debug] li2" instead of "[debug] li1"
My main goal is to have {builderReq} to be changeable via command. If anyone could help out that'd be great.
Edit: Forgot to mention. I've checked forum posts and I've checked multiple wikis. None seem to help out.
wrong usage of variables
for list you need to use ''::*}'' and the end of the variable for multiples elements in it

example
Code:
on load:
    set {blocks::*} to all blocks
    stop

on unload:
    delete {blocks::*}
    stop

on place:
   if {blocks::*} contains event-block:
       #do stuff
       stop
   else:
       #do stuff
       stop
so, change ur variable to {builderReq::*}
 
Status
Not open for further replies.