Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
VAHMPIN 277 Moderation Voter
3 years 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 3 years ago
Edited 3 years 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 277 — 3y
0
worked, thanks again. VAHMPIN 277 — 3y
Ad

Answer this question