About opening a fence gate

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

HKPNW-Owner

Member
Feb 2, 2017
33
0
6
27
Hello,
I'm trying to make a skript which allowed when the player walk in a radius 2 with {pay.%player's uuid%} is true.
I've tried:

code_language.skript:
on block physics:
    loop all players in radius 2 around event-block:
        if {pay.%player's uuid%} is true:
            event-block is open Oak Fence Gate
        else:
            stop

But it's not working at all. Please help.
 
how about if set it as radius?
i guess it depends what you mean
like a radius from the fence? And then what in the radius... the players?
You could do
code_language.skript:
on right-click on oak fence gate:
    loop all players in radius 10 around event-block:
        send "test" to loop-player
 
i guess it depends what you mean
like a radius from the fence? And then what in the radius... the players?
You could do
code_language.skript:
on right-click on oak fence gate:
    loop all players in radius 10 around event-block:
        send "test" to loop-player
i mean it can automatically open when the player is in the specific radius of the gate with {pay.%loop-player's uuid%}/{pay.%player's uuid%} is true
 
that would be hard to do, you would need an event to detect when the player is close
there's an on any movement event, but its really quite terrible to use, because it would basically be constantly looping all players on your server
 
that would be hard to do, you would need an event to detect when the player is close
there's an on any movement event, but its really quite terrible to use, because it would basically be constantly looping all players on your server
get it tho. thanks :emoji_slight_smile:
[doublepost=1532761044,1532760640][/doublepost]I'm now trying like this: (but it's not working and errors appear for sure)

code_language.skript:
on right click on sign:
    if {pay.%player's uuid%} is true:
        set block in radius 5 of player to opened oak fence gate
 
try this
code_language.skript:
on right click on sign:
    if {pay.%player's uuid%} is true:
        loop blocks in radius 5 around event-block:
            if loop-block is oak fence gate:
                set loop-block to opened oak fence gate
 
try this
code_language.skript:
on right click on sign:
    if {pay.%player's uuid%} is true:
        loop blocks in radius 5 around event-block:
            if loop-block is oak fence gate:
                set loop-block to opened oak fence gate
it should be working but... i don't know why it don't... (no errors)
 
ok you're not going to like this, but in this method you can change the data value of the block, I tested this and it works

code_language.skript:
on right click on sign:
    if {pay.%player's uuid%} is true:
        loop blocks in radius 5 around event-block:
            if loop-block is oak fence gate:
                if the data value of loop-block is 1:
                    set the data value of loop-block to 5
                    stop
                if the data value of loop-block is 5:
                    set the data value of loop-block to 1
                    stop
 
ok you're not going to like this, but in this method you can change the data value of the block, I tested this and it works

code_language.skript:
on right click on sign:
    if {pay.%player's uuid%} is true:
        loop blocks in radius 5 around event-block:
            if loop-block is oak fence gate:
                if the data value of loop-block is 1:
                    set the data value of loop-block to 5
                    stop
                if the data value of loop-block is 5:
                    set the data value of loop-block to 1
                    stop
i'm going to give you the whole skript XD. I think it's really the problem above. It's still not working


code_language.skript:
command /pcard:
    trigger:
        if player's balance is greater than or equal to 5:
            remove 5 from balance of player
            send "&5[&a全城通&5] &a已付錢, 請盡快入閘!"
            wait 5 tick
            set {pay.%player's uuid%} to true
            wait 20 tick
            delete {pay.%player's uuid%}
            send "yes"
        else:
            send "&5[&a全城通&5] &a你&4沒有足夠&a的錢"
       
on right click on sign:
    if {pay.%player's uuid%} is true:
        loop blocks in radius 5 around event-block:
            if loop-block is oak fence gate:
                if the data value of loop-block is 1:
                    set the data value of loop-block to 5
                    stop
                if the data value of loop-block is 5:
                    set the data value of loop-block to 1
                    stop
(Some words are Chinese anyway)
 
Status
Not open for further replies.