Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- systems = {'Sol','Proxima','Centauri','Betelgeuse'}
- objectives = {{'Independent Courier',2,'Take package to Proxima station','Give package to Rep. Pruitt'},{'Intelligence Gathering',3,'Head to Centauri station','Access files via Deck B','Return Files to Lt. Montague'}}
- while true do
- update = commands.scoreboard("players test @a Update 1")
- if update then
- page1 = "Visited Systems"
- pageob = ""
- commands.clear("@a written_book")
- for n = 1, #systems do
- testa = commands.scoreboard("players test @a Visit_" .. systems[n] .. " 1")
- if testa then
- page1 = page1 .. "\\\\n- " .. systems[n]
- end
- end
- for i = 1, #objectives do
- valid, response2 = commands.scoreboard("players test @a Objective" .. i .. " 1")
- if valid then
- page = '"[\\"\\",{\\"text\\":\\"' .. objectives[i][1] .. '\\\\n\\\\n\\"},{\\"text\\":\\"'
- complete = commands.scoreboard("players test @a Objective".. i .. " " .. objectives[i][2]+1)
- if complete then
- for j = 1, objectives[i][2] do
- page = page .. objectives[i][2+j]
- if j < objectives[i][2] then
- page = page .. "\\\\n"
- end
- end
- page = page .. '\\",\\"strikethrough\\":true}]"'
- else
- for j = 1, objectives[i][2] do
- pass = commands.scoreboard("players test @a Objective" .. i .. " " .. j .. " " .. j)
- if pass then
- current = j
- end
- end
- for j = 1, current-1 do
- page = page .. objectives[i][2+j] .. "\\\\n"
- end
- page = page .. '\\",\\"strikethrough\\":true},{\\"text\\":\\"' .. objectives[i][current] .. '"color\\":\\"reset\\"}]",'
- pageob = pageob .. page
- end
- end
- end
- commands.give('@a written_book 1 0 {title:"Logbook",author:"Galactic Authority ",pages:["{text:\\"' .. page1 .. '\\"}",' .. pageob .. ']}')
- commands.scoreboard("players set @a Update 0")
- print(response[1])
- end
- end
Add Comment
Please, Sign In to add comment