Captcha

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

Mr_pro68YT

New Member
Jul 4, 2020
9
0
1
23
I am making a captcha skript , it has a feature that wont let you close your inventory until you click the green glass, when i close my inventory it sends the error message (Please complete the captcha) but it sends it so many times skript gives the "main.sk looped infinitley" error. Ive tried asking my friend who is experienced in skript but he doesnt know, here is the part of the code that has the error:
Code:
on inventory close:
    if {doingcaptcha::%player%} is true:
        send "{@prefix} Please complete the captcha!"
        set {_captcha} to a random number between 1 and 26
        open virtual chest named "&cCaptcha" to player
        format gui slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 11 and 12 and 13 and 14 and 15 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 of player with red stained glass pane named " " to run:
            add 1 to {fails::%player%}
            if {fails::%player%} is greater than 4:
                kick player due to "{@prefix} Captcha Failed!"
                set {fails::%player%} to 0
                set {doingcaptcha::%player%} to false
        format gui slot {_captcha} of player with green stained glass pane named "&aClick Me!" to run:
            close player's inventory
            send "{@prefix} Successfuly completed captcha!"
            set {doingcaptcha::%player%} to true
            delete {_captcha}
 
Code:
send "{@prefix} Successfuly completed captcha!"
            set {doingcaptcha::%player%} to true
you have the {doingcaptcha} variable still true, when it closes the players inventory it will open it back up
 
Status
Not open for further replies.