[SKRIPT] Plugin Help

Discussion in 'Spigot Plugin Help' started by SubmissiveMC, Jun 2, 2015.

  1. Hello people of the Spigot Community!

    I have been at work for a top secret server project and need a way for players to enter 3 specific values upon joining. I have started on this skript code but it isn't quite working and I know there are probably some newbie mistakes. I would really appreciate if you guys could take a look at the code for me, thanks!

    The things I need from this skript plugin are to:

    - Deny players of the ability to move or interact with blocks if they haven't answered the values
    - Provide an ingame lookup by an administrative user.

    Right now I am focusing on getting it to work, then I will add the permissions and tidying later.

    Code (Text):
    on join:
        if {allvalues.%player%} is not 3:
            message "Text telling them to do commands"
            set {home.%player%} to location of player

    on join:
        while {registration.%player%} is not 3:
            teleport player to {home.%player%}

    command /value1 <value>:
            if {value1done.%player%} is 0:
                set {value1.%player%} to {arg 1}
                add 1 to {allvalues.%player%}
                message  "&cValue 1 is set, continue..."
                set {value1done.%player%} to 1
                message "This value is set already"

    command /value2 <value>:
            if {value2done.%player%} is 0:
                set {value2.%player%} to {arg 1}
                add 1 to {allvalues.%player%}
                message  "&cValue 2 is set, continue..."
                set {value2done.%player%} to 1
                message "This value is set already"
    command /value3 <value>:
            if {value3done.%player%} is 0:
                set {value3.%player%} to {arg 1}
                add 1 to {allvalues.%player%}
                message  "&cValue 3 is set, continue..."
                set {value3done.%player%} to 1
                message "This value is set already"
    command /infolookup <player>:
            message "&cPlayer {arg 1} value 1 is %{value1.%(arg 1)%}%"
            message "&cPlayer {arg 1} value 2 is %{value2.%(arg 1)%}%"
            message "&cPlayer {arg 1} value 3 is %{value3.%(arg 1)%}%"
  2. I would definitely suggest hiring a developer - Skript can be hacked. You are 17, if I am not wrong right? You should learn some coding.
    • Funny Funny x 1
    • Optimistic Optimistic x 1
  3. Our program doesn't collect funds to run so therefor we have no ways of hiring a developer. We also have several pro-cautions to prevent players like this but I would prefer not to go into too much detail, thanks for the advice though!
  4. P.S: I am a developer - with almost no time.
    • Funny Funny x 1
  5. try changing {arg 1} to argument 1


    Also instead of messages "text" put send "test" to player
  6. wat?

    Code (Text):
    command /value1 <value>:
    should be:
    Code (Text):
    command /value1 <text>:
    ("text" could also be "number", "player", "offlineplayer", etc. Whatever type of input you want)

    {arg 1} should just be arg 1 or argument 1
    #6 Absentee23, Jun 2, 2015
    Last edited: Jun 3, 2015
    • Agree Agree x 3
  7. joshwenke

    Wiki Team

    @xiurobert, Skript can't be "hacked" unless you write bad, exploitable code. This thread isn't for hating on Skript or suggesting alternatives, but rather simply to request help.
    • Agree Agree x 3
  8. Alrighty so that value thing has worked, the thing that is giving me the most trouble is stopping them from moving when they haven't set that value.
  9. Few options I can think of here, in order of easiest/least laggy to hardest/laggiest:

    If using WorldGuard, make a small (1 x 2) region at the spawn or wherever they are when they have to enter these values, and then make an (on exit of region "regionname":) event where you check if all values have been set, and if not cancel the event (which will not let them teleport out, walk out, etc).

    You could also use SkQuery's (A Skript add-on) "on any movement" event (basically the PlayerMoveEvent) and cancel it until the values are all set. Calling PlayerMoveEvent isn't terrible unless you have a LOT of players moving, or if the checks are slow. Checking a variable isn't too bad, but it will happen hundreds to thousands of times a second if there are a lot of players.

    And you could set their location, and make an "every 5 ticks:" repeating event that continuously teleports players back if the value is not set. Don't recommend this unless it will ALWAYS be a low player count, as you'd have to loop all players very fast, repeatedly.

    I recommend the "cancel exiting the region" option.
  10. Thanks for the advice! I'll try the world guard one when I get back on a computer!! Appreciate it :)
  11. You guys always beat me to helping out on Skript problems. Darn you all. :(
  12. I may still have some more hydrus haha
  13. You also do not HAVE TO do

    Code (Text):
    send "hi" to player

    doing a message syntax is fine. The only reason I see that you HAVE TO do a send syntax is if you're dealing with more than one entity, or specific entities.