Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --THIS SCRIPT CONTROLS THE ARRIVAL OF PLAYERS TO THE SERVER BY TELEPORTING THEM TO THE RIGHT LOCATIONS
- --DEPENDING ON THEIR EXPERIENCE: COMPLETED TUTORIAL OR NOT, PLAYED AT LEAST ONE GAME OR NOT, PLAYED MORE THAN 5 GAMES, ETC.
- local VERSION = '0.0.2 - fixed english messages'
- commands.gamerule("doDaylightCycle",false)
- commands.gamerule("doTileDrops",true)
- commands.gamerule("logAdminCommands",false)
- commands.gamerule("commandBlockOutput",false)
- commands.gamerule("showDeathMessages",false)
- commands.scoreboard("objectives","add","tut_state","dummy")
- --tut_state 0 : havent started tutorial
- --tut_state 1 : started tutorial
- --tut_state 2 : finished tutorial
- commands.scoreboard("objectives","add","not_first_login","dummy")
- commands.scoreboard("objectives","add","left_game","stat.leaveGame")
- commands.scoreboard("objectives","add","lifetime","stat.timeSinceDeath")
- commands.time("set",6000)
- print("Starting Spawn Controller")
- WELCOME_AREA = {
- x=12477,
- y=87,
- z=-1826,
- r1=0,
- r2=0
- }
- PLAY_AREA = {
- x=12113,
- y=57,
- z=-1777,
- r1=90,
- r2=0
- }
- TUT_WAIT_AREA = {
- x=12381,
- y=69,
- z=-1716,
- r1=115,
- r2=0
- }
- -- set team names and colors. Players will never see their team name
- TEAMS = {
- {name="new_players",color="red",title="New Players"},
- {name="middle_players",color="blue",title="Players"},
- {name="pro_players",color="green",title="Epic Builders"}
- }
- --messages for players. Change them here.
- --- messsage to brand new players and players who join after they logged off without completing the tutorial
- WELCOME_MESSAGE_EN = "WELCOME TO IBA_GAME | 20.000 BLOCKS!\n This is the INTRODUCTION TOUR. You need to complete it in one go and reach the play area."
- WELCOME_MESSAGE_DE = "DE: WELCOME TO IBA_GAME | 20.000 BLOCKS.\n This is the introduction tour. You need to complete it in one go and reach the play area."
- -- message to players who died before completing the tutorial
- DEATH_NEW_MSG_EN = "Death has no consequence in IBA_GAME, we have put you back at the welcome area.\n COMPLETE THE INTRODUCTION TOUR and reach the play area."
- DEATH_NEW_MSG_DE = "DE: Death has no consequence in 20.000 Blocks, we have put you back at the welcome area.\n Complete the introduction tour and reach the play area."
- WELCOME_LINK_TEXT_EN = "\n VIEW YOUR WORK and discover what others have built at www.20000blocks.com"
- WELCOME_LINK_TEXT_DE = "Discover what others have built at www.20000blocks.com"
- WELCOME_LINK = "https://20000blocks.com/"
- WELCOME_HOVER_TEXT_EN = "Open the website of IBA_GAME | 20.000 BLOCKS"
- WELCOME_HOVER_TEXT_DE = "Open 20.000 Blocks website"
- BACK_MESSAGE_EN = "Welcome back! COMPLETE THE TUTORIAL and then move on to the play area for your first game."
- BACK_MESSAGE_DE = "Welcome back Architect! Complete the tutorial and then move on"
- PLAY_MESSAGE_EN = "Welcome back! Walk into the yellow cube to PLAY YOUR FIRST GAME to help build Heidelberg's new city quarter!"
- PLAY_MESSAGE_DE = "Welcome Back! Congrats on finishing the tutorial. Play your first game to help build the new city!"
- --message to returning older players
- VIEW_MESSAGE_EN = "Welcome back! Play to create the GREENEST, the TALLEST, the DENSEST or the MOST DIVERSE NEIGHBOURHOOD."
- VIEW_MESSAGE_DE = "Welcome back! Remember you can view your work at: "
- PRO_MESSAGE_EN = "Welcome back, Master Builder! Thanks for your contribution to Heidelberg's new city quarter! KEEP PLAYING and finding new ways to combine buildings into a neighbourhood!"
- PRO_MESSAGE_DE = "Welcome back Chief Architect! Thanks for all your contributions to the project so far! "
- --
- DEATH_TUT_MSG_EN = "Don't worry about that! Try completing the tutorial again."
- DEATH_TUT_MSG_DE = "Dont worry about that, lets just try the tutorial again."
- --
- DEATH_NORMAL_MSG_EN = "No worries. Someone probably placed a building on top of you or you fell from a high place. Let's put you back in the game."
- DEATH_NORMAL_MSG_DE = "Somebody probably built something on top of you. Putting you back in the game"
- --tellraw commands, dont touch these. They are made up from the messages above.
- --mesasge to Pro Players / Master Builders
- PRO_TELLRAW_EN = '["",{"text":"'..PRO_MESSAGE_EN..'","color":"white","bold":false},{"text":"'..WELCOME_LINK_TEXT_EN..'","color":"blue","underlined":true,"clickEvent":{"action":"open_url","value":"'..WELCOME_LINK..'"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"'..WELCOME_HOVER_TEXT_EN..'","color":"yellow"}]}},"bold":false}]'
- PRO_TELLRAW_DE = '["",{"text":"'..PRO_MESSAGE_DE..'","color":"gold","bold":false},{"text":"'..WELCOME_LINK_TEXT_DE..'","color":"blue","underlined":true,"clickEvent":{"action":"open_url","value":"'..WELCOME_LINK..'"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"'..WELCOME_HOVER_TEXT_DE..'","color":"yellow"}]}},"bold":false}]'
- --message to Medium Players
- VIEW_TELLRAW_EN = '["",{"text":"'..VIEW_MESSAGE_EN..'","color":"white","bold":false},{"text":"'..WELCOME_LINK_TEXT_EN..'","color":"blue","underlined":true,"clickEvent":{"action":"open_url","value":"'..WELCOME_LINK..'"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"'..WELCOME_HOVER_TEXT_EN..'","color":"yellow"}]}},"bold":false}]'
- VIEW_TELLRAW_DE = '["",{"text":"'..VIEW_MESSAGE_DE..'","color":"gold","bold":false},{"text":"'..WELCOME_LINK_TEXT_DE..'","color":"blue","underlined":true,"clickEvent":{"action":"open_url","value":"'..WELCOME_LINK..'"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"'..WELCOME_HOVER_TEXT_DE..'","color":"yellow"}]}},"bold":false}]'
- --message to new players who completed tutorial but didn't play a game
- PLAY_TELLRAW_EN = '["",{"text":"'..PLAY_MESSAGE_EN..'","color":"white","bold":false}]'
- PLAY_TELLRAW_DE = '["",{"text":"'..PLAY_MESSAGE_DE..'","color":"gold","bold":false}]'
- --message to players who left in the middle of the tutorial
- BACK_TELLRAW_EN = '["",{"text":"'..BACK_MESSAGE_EN..'","color":"white","bold":false}]'
- BACK_TELLRAW_DE = '["",{"text":"'..BACK_MESSAGE_DE..'","color":"gold","bold":false}]'
- --message to players who join for first time or didnt complete the intro tour
- WELCOME_TELLRAW_EN = '["",{"text":"'..WELCOME_MESSAGE_EN..'","color":"white","bold":false}]'
- WELCOME_TELLRAW_DE = '["",{"text":"'..WELCOME_MESSAGE_DE..'","color":"gold","bold":false}]'
- --message to player who died in the Intro Tour
- DEATH_NEW_TELLRAW_EN = '["",{"text":"'..DEATH_NEW_MSG_EN..' ","color":"white","bold":false}]'
- DEATH_NEW_TELLRAW_DE = '["",{"text":"'..DEATH_NEW_MSG_DE..' ","color":"gold","bold":false}]'
- --message to players who died during the tutorial
- DEATH_TUT_TELLRAW_EN = '["",{"text":"'..DEATH_TUT_MSG_EN..' ","color":"white","bold":false}]'
- DEATH_TUT_TELLRAW_DE = '["",{"text":"'..DEATH_TUT_MSG_DE..' ","color":"gold","bold":false}]'
- --message to players who died during a game
- DEATH_NORMAL_TELLRAW_EN = '["",{"text":"'..DEATH_NORMAL_MSG_EN..' ","color":"white","bold":false}]'
- DEATH_NORMAL_TELLRAW_DE = '["",{"text":"'..DEATH_NORMAL_MSG_DE..' ","color":"gold","bold":false}]'
- --setup teams
- commands.scoreboard("teams","add",TEAMS[1].name,TEAMS[1].title)
- commands.scoreboard("teams","add",TEAMS[2].name,TEAMS[2].title)
- commands.scoreboard("teams","add",TEAMS[3].name,TEAMS[3].title)
- commands.scoreboard("teams","option",TEAMS[1].name,"color",TEAMS[1].color)
- commands.scoreboard("teams","option",TEAMS[2].name,"color",TEAMS[2].color)
- commands.scoreboard("teams","option",TEAMS[3].name,"color",TEAMS[3].color)
- local symbols = {
- "(X) ",
- "(-) "
- }
- local spin = 1
- while true do
- term.clear()
- print("Controlling Spawns "..symbols[spin])
- spin = spin +1
- if spin > #symbols then spin = 1 end
- --deal with returning players with tut_state 0
- local returning_new_players = '@a[m=2,team='..TEAMS[1].name..',score_tut_state=0,score_left_game_min=1]'
- commands.spawnpoint(returning_new_players,WELCOME_AREA.x,WELCOME_AREA.y,WELCOME_AREA.z,WELCOME_AREA.r1,WELCOME_AREA.r2)
- commands.tp(returning_new_players,WELCOME_AREA.x,WELCOME_AREA.y,WELCOME_AREA.z,WELCOME_AREA.r1,WELCOME_AREA.r2)
- commands.tellraw(returning_new_players,WELCOME_TELLRAW_EN)
- commands.tellraw(returning_new_players,WELCOME_TELLRAW_DE)
- commands.scoreboard("players","set",returning_new_players,"left_game",0)
- --deal with returning players with tut_state 1
- local returning_tut_players = '@a[m=2,team='..TEAMS[1].name..',score_tut_state=1,score_tut_state_min=1,score_left_game_min=1]'
- commands.spawnpoint(returning_tut_players,TUT_WAIT_AREA.x,TUT_WAIT_AREA.y,TUT_WAIT_AREA.z,TUT_WAIT_AREA.r1,TUT_WAIT_AREA.r2)
- commands.tp(returning_tut_players,TUT_WAIT_AREA.x,TUT_WAIT_AREA.y,TUT_WAIT_AREA.z,TUT_WAIT_AREA.r1,TUT_WAIT_AREA.r2)
- commands.tellraw(returning_tut_players,BACK_TELLRAW_EN)
- commands.tellraw(returning_tut_players,BACK_TELLRAW_DE)
- commands.scoreboard("players","set",returning_tut_players,"left_game",0)
- --deal with returning players with tut_state 2
- local returning_players = '@a[m=2,team='..TEAMS[1].name..',score_tut_state=2,score_tut_state_min=2,score_left_game_min=1]'
- commands.spawnpoint(returning_players,PLAY_AREA.x,PLAY_AREA.y,PLAY_AREA.z,PLAY_AREA.r1,PLAY_AREA.r2)
- commands.tp(returning_players,PLAY_AREA.x,PLAY_AREA.y,PLAY_AREA.z,PLAY_AREA.r1,PLAY_AREA.r2)
- commands.tellraw(returning_players,PLAY_TELLRAW_EN)
- commands.tellraw(returning_players,PLAY_TELLRAW_DE)
- commands.scoreboard("players","set",returning_players,"left_game",0)
- --deal with returning older players
- local returning_old_players = '@a[m=2,team='..TEAMS[2].name..',score_left_game_min=1]'
- commands.spawnpoint(returning_old_players,PLAY_AREA.x,PLAY_AREA.y,PLAY_AREA.z,PLAY_AREA.r1,PLAY_AREA.r2)
- commands.tp(returning_old_players,PLAY_AREA.x,PLAY_AREA.y,PLAY_AREA.z,PLAY_AREA.r1,PLAY_AREA.r2)
- commands.tellraw(returning_old_players,VIEW_TELLRAW_EN)
- commands.tellraw(returning_old_players,VIEW_TELLRAW_DE)
- commands.scoreboard("players","set",returning_old_players,"left_game",0)
- --deal with returning pro players
- local returning_pro_players = '@a[m=2,team='..TEAMS[3].name..',score_left_game_min=1]'
- commands.spawnpoint(returning_pro_players,PLAY_AREA.x,PLAY_AREA.y,PLAY_AREA.z,PLAY_AREA.r1,PLAY_AREA.r2)
- commands.tp(returning_pro_players,PLAY_AREA.x,PLAY_AREA.y,PLAY_AREA.z,PLAY_AREA.r1,PLAY_AREA.r2)
- commands.tellraw(returning_pro_players,PRO_TELLRAW_EN)
- commands.tellraw(returning_pro_players,PRO_TELLRAW_DE)
- commands.scoreboard("players","set",returning_pro_players,"left_game",0)
- --deal with brand new players
- local new_players = "@a[m=2,team=]"
- commands.scoreboard("players","set",new_players,"lifetime",1500)
- commands.scoreboard("players","set",new_players,"not_first_login",0)
- commands.scoreboard("players","set",new_players,"left_game",0)
- commands.scoreboard("players","set",new_players,"tut_state",0)
- commands.tellraw(new_players,WELCOME_TELLRAW_EN)
- commands.tellraw(new_players,WELCOME_TELLRAW_DE)
- commands.spawnpoint(new_players,WELCOME_AREA.x,WELCOME_AREA.y,WELCOME_AREA.z,WELCOME_AREA.r1,WELCOME_AREA.r2)
- commands.tp(new_players,WELCOME_AREA.x,WELCOME_AREA.y,WELCOME_AREA.z,WELCOME_AREA.r1,WELCOME_AREA.r2)
- commands.scoreboard("teams","join",TEAMS[1].name,new_players)
- --deal with dead players with tut_state 0
- local dead_newbies = '@a[m=2,score_lifetime=20,score_lifetime_min=1,score_tut_state_min=0,score_tut_state=0]'
- commands.tellraw(dead_newbies,DEATH_NEW_TELLRAW_EN)
- commands.tellraw(dead_newbies,DEATH_NEW_TELLRAW_DE)
- --deal with dead players with tut_state 1
- local dead_tut_players = '@a[m=2,score_lifetime=20,score_lifetime_min=1,score_tut_state_min=1,score_tut_state=1]'
- commands.tellraw(dead_tut_players,DEATH_TUT_TELLRAW_EN)
- commands.tellraw(dead_tut_players,DEATH_TUT_TELLRAW_DE)
- --deal with dead players and with other dead players who probably died in a campaign
- local dead_players = '@a[m=2,score_lifetime=20,score_lifetime_min=1,score_tut_state_min=2,score_tut_state=2]'
- commands.tellraw(dead_players,DEATH_NORMAL_TELLRAW_EN)
- commands.tellraw(dead_players,DEATH_NORMAL_TELLRAW_DE)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement