Solved [SKRIPT] Help?? Variables and Conditions are getting on my nerves

Discussion in 'Spigot Plugin Help' started by Aberts10, May 18, 2015.

  1. <code> Variables:
    %time% = 0

    On join:
    wait 5 seconds
    broadcast "&8[&aSECURITY&8] You Have 30 Seconds to Enter '.legit' into the chat!"
    wait 1 second:
    set {%_time%} = "1"
    wait 1 second:
    set {%_time%} = "2"
    wait 1 second:
    set {%_time%} = "3"
    wait 1 second:
    set {%_time%} = "4"
    wait 1 second:
    set {%_time%} = "5"
    wait 1 second:
    set {%_time%} = "6"
    wait 1 second:
    set {%_time%} = "7"
    wait 1 second:
    set {%_time%} = '8"
    wait 1 second:
    set {%_time%} = "9"
    wait 1 second:
    set {%_time%} = "10"
    if {%_time%} is less than "10":
    execute console command "/kick %player% You Must Enter .legit Before 30 Seconds!"
    else:
    broadcast "&8[&aSECURITY&8] You Have 30 Seconds to Enter '.legit' into the chat!"
    stop
    On chat if {%_time%} = 10:
    execute console command "/kick %player% You Must Enter .legit Before 30 Seconds!"
    else:
    if %time% is less than 10:
    execute console command "/kick %player% You Must Enter .legit Before 30 Seconds!"
    else:
    execute console command "/kick %player% You Must Enter .legit Before 30 Seconds!"
    stop </code>

    Im trying to make a Simple Security Skript that requires a player to enter .legit into the chat before 30 seconds is up.... The issue is that im used to real coding and not this BS so its confusing the hell out of me as im not used to this.... Can someone care to help me figure out this mess.... Oh and by the way i've already had 6 revisions.... i can't post them all though because they failed and i deleted them.
     
  2. It's the same as any other language. Use a loop that checks if said condition is met in the allotted time, if not do x.
    @nfell2009 Should be able to elaborate.
     
    • Like Like x 1
  3. Proper variable: {_time}
     
    • Like Like x 1
  4. If you know "real coding" then go use it. Skript is hardly confusing. A stupid person makes it confusing. I cannot tell if you just made it up as you were going along.
     
    • Agree Agree x 3
  5. My skript is rusty but this should more or less work.
    If you want it to be .legit, register event to listen for .legit then do same thing but /legit is easier.
    Code (Text):
    on join:
        set {security.%player%} to false
        message "You have 30 seconds to execute command /legit"
        wait 30 seconds
        if {security.%player%} is false:
            kick player

    command /legit:
        set {security.%player%} to true
        message "blah blah blah"
     
    • Informative Informative x 2
  6. Code (Text):

    on chat:
    if message is ".legit":
      set {security.%player%} to true
     
    EDIT: You forgot the "trigger:" part of the command :p
     
    • Like Like x 1
  7. No idea if thats formatted right even, since you didn't put it in code tags (use [], not<>) or post it on pastebin. Intendations are VERY important in Skript.

    You should also look at the documentation or look at Skunity.com and follow the examples of some events, as you're using those improperly too (some can get more advanced and include conditions in the event, but keep it simple for now...):
    Code (Text):
    On chat if {%_time%} = 10:
    should look like
    Code (Text):
    on chat:
            if {_time} = 10
    You should read the DOCS on variables, so you actually know how to use them.

    You shouldn't need colons after the wait lines, unless you're going to indent each line after it more and more and more.

    ---

    Just like the "real coding" language you claim to know, Skript has a syntax you need to learn and follow. Read the documentation!

    If Skript is too confusing I can't imagine what you consider "real coding." HTML?
     
    #7 Absentee23, May 18, 2015
    Last edited: May 18, 2015
    • Like Like x 2
    • Agree Agree x 1
    • Winner Winner x 1
  8. OT: There are still easy possibilities to send .legit even with such a hacked client. No real protection.
     
    • Agree Agree x 3
  9. This looks more like spambot protection, a spambot wont think to send .legit
     
  10. Im going to make some Spigot plugins over my break, i don't have a reason to work with Skript, because it was just annoying, and isn't as in-depth as java.
     
    • Funny Funny x 2
    • Winner Winner x 1
    • Optimistic Optimistic x 1