Built-in library for manipulating Roblox place & model files
Example usage
local roblox =require("@lune/roblox")-- Reading & writing a place filelocal game = roblox.readPlaceFile("myPlaceFile.rbxl")local workspace = game:GetService("Workspace")for _, child in workspace:GetChildren() doprint("Found child " .. child.Name .." of class " .. child.ClassName)endroblox.writePlaceFile("myPlaceFile.rbxl", game)
Functions
getAuthCookie
functionRoblox.getAuthCookie(raw:boolean?)
Gets the current auth cookie, for usage with Roblox web APIs.
Note that this auth cookie is formatted for use as a "Cookie" header, and that it contains restrictions so that it may only be used for official Roblox endpoints. To get the raw cookie value without any additional formatting, you can pass true as the first and only parameter.
Example usage:
local roblox =require("@lune/roblox")local net =require("@lune/net")local cookie = roblox.getAuthCookie()assert(cookie ~=nil, "Failed to get roblox auth cookie")local myPrivatePlaceId =1234567890local response = net.request({ url ="https://assetdelivery.roblox.com/v2/assetId/" ..tostring(myPrivatePlaceId), headers = { Cookie = cookie, },})local responseTable = net.jsonDecode(response.body)local responseLocation = responseTable.locations[1].locationprint("Download link to place: " .. responseLocation)
readModelFile
functionRoblox.readModelFile(filePath:string)
Reads a model file into a table of instances.
Example usage:
local roblox =require("@lune/roblox")local instances = roblox.readModelFile("filePath.rbxm")
readPlaceFile
functionRoblox.readPlaceFile(filePath:string)
Reads a place file into a DataModel instance.
Example usage:
local roblox =require("@lune/roblox")local game = roblox.readPlaceFile("filePath.rbxl")