Log in to vote

How would i format %x to be a readable format for assetID's?

Asked by
VAHMPIN 281 Moderation Voter
13 days ago

code example so not request:

local format = "%x"
local formatted = string.format(format, "7846242414") -- fake assetID btw

1 answer

Log in to vote
Answered by 13 days ago
Edited 13 days ago

Hey, this is pretty easy to do, all you need to do add is the "#" to the x.

This makes the formatting readable, for example you can do this on an audio assetID:

local Format = "%#x" -- turns the hex (%x) into a readable roblox format by making x = #x
local Formatted = string.format(Format, "152745539")
local AssetID = "rbxassetid://" .. Formatted

local Sound ="Sound")
Sound.Playing = true
Sound.Looped = true
Sound.SoundId = AssetID
Sound.Parent = workspace
I'll test this now, thanks. VAHMPIN 281 — 13d
worked, thanks again. VAHMPIN 281 — 13d

Answer this question