Solved I try to add coordinates to a variable list and this happened... (GONE WRONG)

  • 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.

NewbyZ

Member
Jan 26, 2017
75
2
0
25
Hello, why doesn't work this?

code_language.skript:
command /slime1:
    permission: slime.slime
    trigger:
        delete {slime1::*}
        loop blocks in radius 10 around player:
            if loop-block is slime block:
                add location of loop-value to {slime1::*}
        broadcast "%{slime1::*}%"

on step on slime block:
    set {_loc} to location of event-block
    loop {slime1::*}:
        if loop-value contains {_loc}:
            push the player upwards at speed 1.2
            broadcast "&aOh"
 
1. you shouldn't check if the looped value contains the location, it's a single value, you should check if the looped value is the location.
2. there are better ways to do what you're trying to do, like instead of add the location to the list, do the following:

code_language.skript:
loop blocks in radius 10 of player where [block input is slime block]: #The where is the where filter expression from skQuery.
    set {slime1::%loop-block's location%} to true
And then check:
code_language.skript:
if {slime1::%event-location%} is set:
    push player upwards at speed 1.2
 
  • Like
Reactions: NewbyZ
1. you shouldn't check if the looped value contains the location, it's a single value, you should check if the looped value is the location.
2. there are better ways to do what you're trying to do, like instead of add the location to the list, do the following:

code_language.skript:
loop blocks in radius 10 of player where [block input is slime block]: #The where is the where filter expression from skQuery.
    set {slime1::%loop-block's location%} to true
And then check:
code_language.skript:
if {slime1::%event-location%} is set:
    push player upwards at speed 1.2

Thanks :emoji_grinning:
 
Status
Not open for further replies.