Skip to content

PXR0-DEV/PXR0-DEV.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

local HttpService = game:GetService("HttpService")

local DATA_CHARACTER_LIMIT = 200

local function encodeTableAsLaunchData(data) -- convert the table to a string local jsonEncodedData = HttpService:JSONEncode(data)

if #jsonEncodedData <= DATA_CHARACTER_LIMIT then
	-- escape potentially invalid characters, such as spaces
	local urlEncodedData = HttpService:UrlEncode(jsonEncodedData)
	return true, urlEncodedData
else
	-- report character limit error
	return false, ("Encoded table exceeds %d character limit"):format(DATA_CHARACTER_LIMIT)
end

end

local sampleData = { joinMessage = "Hello!", urlCreationDate = os.time(), magicNumbers = { 534, 1337, 746733573, }, }

local success, encodedData = encodeTableAsLaunchData(sampleData)

if success then print(encodedData) else warn("failed to encode launch data: " .. encodedData) end

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published