Require assistance for a problematic skript (For Minecraft)

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

WestinGames

New Member
Feb 12, 2022
8
0
1
16
This skript is for a server that I am working on. The use for this skript is basically a portal skript but where only one person can be in that room at a time. this is because this is an independent gamemode to practice you're aim in PVP. Here is my problem. There are multiple areas, and only one person is abled to be in a area at a time (An 8x 8 area around the carpet) You can go into one area fine with the portal to go there but then when another player tries to go though it doesen't teleport them to another area.
tp them. Here is the skript:
JavaScript:
on load:
    if {i::*} is not set:
        set {i::*} to 0

on place of lime carpet:
    add location of event-block to {warps::*}
    send "location added to warps!"

on break of lime carpet:
    if {warps::*} contains location of event-block:
        remove location of event-block from {warps::*}
        send "location removed from warps!"

on break of red carpet:
    if {warps::*} contains location of event-block:
        remove location of event-block from {warps::*}
        send "location removed from warps!"

on portal:
    cancel event
on step on end portal:
    loop {node::available::*}:
        if block at location of loop-value-1 is lime carpet:
            send "hi"
            teleport player to loop-value-1
            set block at loop-value-1 to red carpet
            remove location of loop-value-1 from {node::available::*}
            add location of loop-value-1 to {node::inuse::*}
            stop
        else:
            send "&cNo available nodes!"
            stop

#every 20 seconds:
    loop {node::*}:
        while block at location of loop-value-1 is red carpet:
            loop players in radius 10 around loop-value-1:
                if loop-value-2 contains a player:
                    stop
                else:   
                    set block at location of loop-value-1 to lime carpet
                    stop
                
        
        

    #loop {warps::*}:
    #    if block at location of loop-value-1 is lime carpet:
    #        teleport player to loop-value-1
    #        set block at loop-value-1 to red carpet
    #        stop
    #    if block at location of loop-value-1 is red carpet:
    #        loop players in radius 8 of loop-value-1:
    #            set {_p} to loop-value-2
    #            if {_p} is set:
    #                stop
    #            else:
    #                set block at loop-value-1 to lime carpet

command /setnode:
    trigger:
        set {node::available::%{i::*}%} to location of player
        set block at location of player to lime carpet
        add 1 to {i::*}
        send "&bnode set!"

command /clearnode:
    trigger:
        delete {node::*}
        delete {i::*}

command /clearwarps:
    trigger:
        delete {warps::*}