For some reason this skript is not working

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

_XxfedexX_

Member
Oct 6, 2020
29
2
3
25
Hi everyone and thanks for clicking on this post.
I got a problem:
I want to write a sort of Orebfuscator by myself in skript.
For some reason this code is not working: it gives no error, but, when I x-ray, i can see all diamonds, even if they are not near to caves/air.
I got the latest Skquery version installed.
Code:
on chunk load:
    loop blocks within event-chunk:
        loop-block is diamond ore:
            loop blocks in radius 1 around loop-block:
                loop-block-2 is air or cave air or grass or water or lava or fence:
                    stop
                wait 1 second
                loop all players:
                    make loop-player see loop-block-1 as stone
6413_87853aecf9e081f506cef298cea42ccc.png

[doublepost=1603197813,1603196345][/doublepost]Ok i found what isn't working but I can't figure out HOW to fix this.
The bug is at
make loop-player see loop-block-1 as stone
For some reason, the player dont accept the block change or something like that.
Please help!
 

Attachments

  • 2020-10-20_14.15.08.png
    276.6 KB · Views: 106
I wouldn't use skript to make this for many reasons. When you use ghost blocks, if they relog they can see the normal blocks again. Also, normal chunk loading is already intensive enough for most servers so you don't want to make it worse.
 
I wouldn't use skript to make this for many reasons. When you use ghost blocks, if they relog they can see the normal blocks again. Also, normal chunk loading is already intensive enough for most servers so you don't want to make it worse.
I know. I didn't asked if this is a good idea. I just asked for help.
 
You could use on chunk enter. it would not lag the server as much

this works for me.

Code:
on chunk enter:
    loop blocks within event-new-chunk:
        loop-block is diamond ore:
            loop blocks in radius 1 around loop-block:
                loop-block-2 is air or cave air or grass or water or lava or fence:
                    add 1 to {_air}
            if {_air} <= 0:
                loop all players:
                    make loop-player see loop-block-1 as stone
            set {_air} to 0

it Requires:

MorkazSK 1.1 or newer
 
You could use on chunk enter. it would not lag the server as much

this works for me.

Code:
on chunk enter:
    loop blocks within event-new-chunk:
        loop-block is diamond ore:
            loop blocks in radius 1 around loop-block:
                loop-block-2 is air or cave air or grass or water or lava or fence:
                    add 1 to {_air}
            if {_air} <= 0:
                loop all players:
                    make loop-player see loop-block-1 as stone
            set {_air} to 0

it Requires:

MorkazSK 1.1 or newer
Thanks you!
[doublepost=1603650145,1603557109][/doublepost]
You could use on chunk enter. it would not lag the server as much

this works for me.

Code:
on chunk enter:
    loop blocks within event-new-chunk:
        loop-block is diamond ore:
            loop blocks in radius 1 around loop-block:
                loop-block-2 is air or cave air or grass or water or lava or fence:
                    add 1 to {_air}
            if {_air} <= 0:
                loop all players:
                    make loop-player see loop-block-1 as stone
            set {_air} to 0

it Requires:

MorkazSK 1.1 or newer

Nope, this is not working.
It doesnt give a compile error or any sort of error, but it just keeps diamonds visible.
I tried this code:
Code:
on chunk enter:
    loop blocks within event-new-chunk:
        loop-block is diamond ore:
            make loop-player see loop-block-1 as stone
but, like your code, it is not working. Why?
EDIT: I installed newer version of Skript and it is working!
 
Status
Not open for further replies.