every second event skript

Discussion in 'Skript' started by Creeper_Pro20, Jul 7, 2018.

  1. Can you give me links on where I can get the missing add-ons? Lel I forgot I sent them
    #41 Creeper_Pro20, Jul 12, 2018
    Last edited: Jul 15, 2018
    • Funny Funny x 1
  2. Thank you! It works perfectly fine! The only problem is that for example when I get 10-15 blocks away from a zombie spawnpoint, they stop spawning. Also is there a way to make the zombies have some sort of AI to break doors windows etc. with a plugin? Also, when I die-lose, it respawns me to the default spawnpoint and doesn't stop the game.
  3. 1. Nice it works
    2. Probably just a render bug, check if they have spawned after the moment when you can't see them
    3. No idea, google it
    4. Add some sort of death counter for the player(s) in your game and if that number changes you stop the while loop (can't make it myself rn, I'm on my phone)
  4. So I continued the skript and I almost finished it. The only things I want you to tell me is a command on how to stop the zombies from spawning, a command to kick all players and a way to make the skript execute commands in-game (I typed in the skript execute command "/time set ... it couldn't recognise it) Shall I sent you the new code I made?
  5. Yes please
  6. Execute ingame commands with the console.
    Code (Text):
    execute console command "time set day"
    Command to kick all players:
    Code (Text):
    command /kickall:
        permission: kick
            loop all players:
                kick loop-player due to "You have been kicked!"
  7. Χωρίς τίτλο.gif
  8. Will this also work if I type it like this? execute console command "kickall"
  9. You don't need to use a console command, just do
    kick all players
  10. ok I will try
  11. The zombies stop spawning when you kick a player / a player joins. For the other two you can use what @ShaneBee and @Efnilite said
  12. Ok. But you said when a player joins, it stops spawning. Can I make it to stop only after everyone leaves?
  13. Allright sure. Try this:
    Code (Text):
        ActionBars: true #Enable/disable action bars!#
        CountdownStart: &7A countdown has begun! #The message that is sent when a countdown begins.#
        CountdownMsg: &7{TIME} #This is the format of time that will be sent in a countdown time message.#
        CountdownEnd: &7The countdown has ended! #This message will be sent when a countdown ends.#
        NoTimeSet: &7Please specify some seconds. #This is sent if a user does not enter a valid time input when creating a countdown.#
        NoPermMsg: &7No Permission! #This is sent if a user does NOT have permission for a command.#
        Prefix: &8[&6Countdown&8] &7 #This is the prefix of the Script.#
        Permission: countdowncommand.use #This is the permission of the Script command.#
        Titles: true #Set to true to enable Titles (BETA!)#
        TopTitleLine: &cNotice! #Set the top line of a title to something!#
        UpdaterPermission: countdowncommand.updater #Permission to use the /countdownupdater command!#
        CountdownCancelled: &7The countdown was cancelled!

    on connect:
        message "&2Welcome to Protect The House minigame by Creeper_Pro20! Instructions: As you can see, you are in a house. Your purpose is to protect it from the monsters which will be arriving tonight!! When the game starts you will receive some weapons to keep the monsters out. Night is coming! Good luck..."
        if size of all players > 4:
            kick player due to "&4The Server is Full!"
        else if size of all players is 1:
            # execute command "/countdown 20"
            execute command "/time set 12500"
            set {_s} to size of all players
            wait 20 seconds
            if size of all players != {_s}:
            while size of all players != 0:
                spawn a zombie at {zombie.spawn}
                set {_entity} to last spawned entity # this isn't neccesary as you don't do anything with the variable
                wait 10 seconds

    command /setzombie:
            player is op
            set {zombie.spawn} to location of player
    function zombieCountdown(seconds: integer):
        set {_s} to size of all players
        broadcast "{@Prefix}{@CountdownStart}"
        wait 1 second
        set {_time} to {_seconds}
        loop {_seconds} times:
            if size of all players != {_s}:
                broadcast "{@Prefix}{@CountdownCancelled}"
            set {_m} to "{@CountdownMsg}"
            replace all "{TIME}" in {_m} with "%{_time}%"
            broadcast "{@Prefix}%{_m}%"
            if {@Titles} is true:
                loop {_seconds} times:
                    send all players title "{@TopTitleLine}" with subtitle "%{_m}%" for 1 seconds
            if {@ActionBars} is true:
                set action bar of player to "&6Countdown: &7%{_m}%"
            wait 1 seconds
            remove 1 from {_time}
        broadcast "{@Prefix}{@CountdownEnd}"
  14. What is the event when everyone dies? I currently have it as on death of all players but it doesn't recognise it
  15. Set a list variable to all players at the start, when a player dies, remove him from that list and check if the list is set. If not, all players died
  16. I made it and it works very good! The only thing I encountered was that I can only set 1 zombie spawnpoint. I have always to manualy set the second. Any ideas? The overall minigame works perfectly fine.
  17. For the zombie spawnpoints, you can set a list variable and add a location with a command and when you want to spawn a zombie loop through the list and spawn them at the loop-value
  18. Ok. I fixed it. I also made it to spawn more mobs successfully! I played it with a friend and it was really fun. Anyway can you help me make it start the game in a different amound of seconds? And also how do you make it to not allow players to join after the countdown ended?
    #59 Creeper_Pro20, Jul 15, 2018
    Last edited: Jul 15, 2018
  19. 1. Change the seconds in the wait effect and the countdown function
    2. Set a variable to true when the game has started and delete it when it ended. When a player connects (on connect), if the variable is true, kick him

Share This Page