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

How do i access roblox files in scripts?

Asked by
exit16 20
10 years ago

Hey guys i've noticed in scripting that when i've been trying to access roblox files such as a shirt it will show as something like this "Rbx:asset//textures" why can't i use the direct id like "http://web.roblox.com/Blond-Dreamy-Hair-item?id=185812332" if i can't possibly use the direct id method than can someone please teach me how to define an id or access the roblox files? Thanks.

0
Thanks dude this works it gave me an idea but i needed to know everything else but now i know thanks. exit16 20 — 10y

2 answers

Log in to vote
3
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

ROBLOX doesn't allow you to directly access their web servers for probably a good reason. To get around this, we have a specific route to access ROBLOX textures within a game: the rbxassetid:// protocol. This is not the same as rbxasset://, which is used to access files saved locally to your computer.

There are two assets that you can load using rbxassetid://, and they are Images and Meshes.

For an example, any time you have an Image field (as in a Decal), you could put in rbxassetid://29268434 to get a nice little image of a crack with a hole in the middle. The ShirtTemplate and PantsTemplate also use Images, but they require specific dimensions. Same as TShirts.

To get the asset ID of an Image (from a Decal, Shirt, TShirt, or Pants), go to the item's page, and subtract 1 from the asset in the URL until you find the ROBLOX Image. For example, if you put the asset ID I provided above into the URL of any item's page, you'll be directed to this page. Notice this item's type: ROBLOX Image. If you add 1 to this URL, you'll find the ROBLOX Decal of the item.

To give another example, here is an item with the ROBLOX Shirt type from the front page of the catalog. If you subtract 1 from this URL, you get a ROBLOX Image item, the ShirtTemplate.

Sometimes, the Decal or Shirt of Pants and its image will not be just 1 assetID away from each other. This problem is present with this Decal. If you subtract 1 from the URL, you'll find a Gamepass! Subtract 1 more, and you'll find a Shirt Template ROBLOX Image! Subtract a third time, and you'll find the ROBLOX Image of the Decal.


Now, the other asset type, Meshes, can only be obtained in-game. There used to be a Catalog section for them, but ROBLOX disabled it. You cannot access Mesh assetIDs directly from Hats or Gears, you have to load them in-game and pull them out from the Hat's or Gear's Mesh.

Ad
Log in to vote
-1
Answered by 10 years ago

To get an Rbxasset, you subtract one from the original ID on the ROBLOX website. For the "Blond Dreamy Hair" hat, the original ID would be 185812332. To get the asset ID we subtract one, 185812331. This doesn't work with just hats. It works with pants, shirt, and even sounds too.

0
This doesn't  actually work with  meshes. adark 5487 — 10y
0
I never said it did SenorPiggy 10 — 10y

Answer this question