Ad
Log in to vote
0

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
1
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 = Instance.new("Sound")
Sound.Playing = true
Sound.Looped = true
Sound.SoundId = AssetID
Sound.Parent = workspace
0
I'll test this now, thanks. VAHMPIN 281 — 13d
0
worked, thanks again. VAHMPIN 281 — 13d
Ad

Answer this question