Question
How would I grab the asset ID of a decal through a script? I’ve looked through the API Roblox Site, however I couldn’t find a solution.
Example ID
Marketplace Link: nWoSouledOut2 - Roblox
Asset Link: http://www.roblox.com/asset/?id=5322863485
Script
local function Play()
if script.Parent.Power.Value == true then
if game.Workspace:FindFirstChild("Equipment") then
repeat
game.Workspace.Equipment.Screens[script.Name].Image = "rbxassetid://"..script.IDValue.Value
wait(0.1)
until script.Parent.Power.Value == false
else
repeat
game.Workspace[script.Name].Decal.Texture = "rbxassetid://"..script.IDValue.Value
wait(0.1)
until script.Parent.Power.Value == false
end
end
end
repeat
Play()
wait(0.1)
until script.Disabled == true
Thank you for any help you can give me.
2 Likes
You can try something like
local image = "https://www.roblox.com/library/5541301688/Images-RobloxScreenShot20200811-163250287"
local splitstring = string.split(image, "/")
print(splitstring[5])
local Product = "https://www.roblox.com/library/5322863519/nWoSouledOut2"
local splitstringProduct = string.split(Product, "/")
print(splitstringProduct[5])
I tried it in studios it worked
This is what the asset ID would be for the decal I posted in my post, your simply printing the string that goes to the marketplace ID. I need the Asset ID, not the marketplace ID.
Thank you for trying though.
1 Like
Two years old; this is nuts to think about. Well I finally made an asset loader module so I can easily explain this.
Answer
To do what I was looking for here; you need to load the asset into your game via; InsertService and the Marketplace Service.
After this, you can change your decals ID to match the one that was inserted; you can then delete the inserted decal.
1 Like