Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local my_title = "I'm some kind of demonstation text"
- local my_contents = [[This is a demonstration
- for multiline contents
- the end.]]
- -- For testing
- --minetest.register_on_joinplayer(function(player)
- minetest.register_on_newplayer(function(player)
- local inv = player:get_inventory()
- local book = ItemStack("default:book_written")
- book:get_meta():from_table({
- title = my_title,
- description = my_title,
- owner = "#!SERVER!#",
- text = my_contents,
- page = 1,
- page_max = math.ceil((#my_contents:gsub("[^\n]", "") + 1) / 14)
- })
- inv:add_item("main", book)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement