Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [] = things you enter in yourself
- This is the documentation for the Scoreboard API
- not really just a simple walkthrough of the API
- -- Making a board
- making a board is fairly simple just use [apiname].new("board") this returns a function so doing [apiname].new("board")() will actually make it, you can't really use it at the moment though, because this requires a table of objects, those objects are: a Title and Lines.
- A Title is a simple object made like this: [apiname].new("title")([name-for-the-scoreboard])
- Lines are made a bit differently, like this: [apiname].new("line")([name/text],[value/score],[color])
- so a little bit of an example:
- ---------------------------------------
- local lines = {}
- title = board.new("title")("Scores")
- red = board.new("line")("Red",1,"red")
- blue = board.new("line")("Blue",4,"blue")
- table.insert(lines,title)
- table.insert(lines,red)
- table.insert(lines,blue)
- local sBoard = board.new("board")(lines)
- sBoard.generate()
- ---------------------------------------
- -- Colors
- as you saw i used "red" and "blue" but you can also use a couple of computercraft colors
- these are:
- colors.lightGray
- colors.green
- colors.lime
- colors.blue
- colors.lightBlue
- colors.gray
- colors.pink
- colors.black
- colors.purple
- colors.red
- colors.white
- -- End
- This is all you need for now, if you have any ideas, have a question or found any bugs please message me on the CC Forums or post on this forum thread: http://www.computercraft.info/forums2/index.php?/topic/27862-scoreboard-api/
Advertisement
Add Comment
Please, Sign In to add comment