Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- COPYRIGHT REBRALA 12/8/2016!!! pls don't copy it around :)
- O4C = {"black",
- "dark_blue",
- "dark_green",
- "dark_aqua",
- "dark_red",
- "dark_purple",
- "gold",
- "gray",
- "dark_gray",
- "blue",
- "green",
- "aqua",
- "red",
- "light_purple",
- "yellow",
- "white"}
- board = { -- An 'empty' scoreboard to start with
- ["title"] = "Null",
- ["lines"] = {
- ["first"] = {
- ["label"] = "Null",
- ["value"] = 0,
- ["color"] = "white",
- },
- }
- }
- Args = {...}
- if Args[1] == "init" then
- commands.gamerule("commandBlockOutput false")
- for k,v in pairs(O4C) do
- commands.scoreboard("teams add "..v)
- commands.scoreboard("teams option "..v.." color "..v)
- print("Added "..v)
- end
- print("Init Complete! Run the program without any arguments to test")
- return
- end
- if Args[1] == "de-init" then
- for k,v in pairs(O4C) do
- commands.scoreboard("teams remove "..v)
- end
- print("Removed all colors")
- return
- end
- if Args[1] == "load" then
- if Args[2] ~= nil and fs.exists(Args[2]) then
- file = fs.open(Args[2],"r")
- board = textutils.unserialise(file.readAll())
- end
- end
- --file = fs.open("","r")
- --board = textutils.unserialise(file.readAll())
- function makeLine(name,label,value)
- commands.scoreboard("players set "..label.." "..name.." "..value)
- end
- function setColor(name,color)
- commands.scoreboard("teams join "..color.." "..name)
- print("Set "..name.."'s color to "..color)
- end
- function removeBoard(name)
- commands.scoreboard("objectives remove "..name)
- end
- function makeBoard(name)
- removeBoard(name)
- commands.scoreboard("objectives add "..name.." dummy "..board.title)
- for k,v in pairs(board.lines) do
- makeLine(name,v.label,v.value)
- setColor(v.label,v.color)
- end
- commands.scoreboard("objectives setdisplay sidebar "..name)
- end
- print("made by ReBraLa")
- commands.gamerule("commandBlockOutput false")
- makeBoard("boardd")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement