Content

(Redirected from API:Content)
< Scripting | Data Types
Content is a data type that is closely related to a string. In fact, it is a string. Usually, a content data type is a link to a file. On some objects, setting the property that uses this value type is forbidden.

Diagram showing how links get passed.

On ROBLOX, the ContentFilter service causes any links to files not on one of the Roblox sites or on the trusted sites to not load. The picture on the right shows how the filter works.


How content is formatted[edit]

Content can be formatted in many ways. All of which either point to an online file or a file saved to the client's computer. The basic structure is a protocol name, followed by ://, then a string that depends on the protocol used.

(protocol)://(string)

Here is a table of valid protocols:

Protocol String Description
rbxasset A file path. Fetches a file from Roblox's content folders.
http A website URL. Fetches content from a website using a URL.
https A website URL. Same as http, but for pages that require https.
rbxhttp A path on the Roblox website. Fetches content from the Roblox website.
rbxassetid An existing asset ID. Fetches a user-created asset on the Roblox website.

Protocols[edit]

rbxasset[edit]

This starts from Roblox's content folder on the user's computer.

Example:

rbxasset://textures/GunCursor.png

Any file in this folder can be used, including ones that users have added themselves. Though it will only appear for that user, since it's only on the user's computer.

Here's the location of the content folder for various operating systems:

Windows XP
C:\Documents and Settings\<username>\Local Settings\Application Data\RobloxVersions\<version>\content
Windows Vista/7/8
C:\Users\<username>\AppData\Local\Roblox\Versions\<version>\content

rbxhttp[edit]

rbxhttp://directory This basically just adds the directory to the end of ContentProvider.BaseUrl.

For example:

rbxhttp://Thumbs/Avatar.ashx?x=100&y=100&format=png&username=Roblox

Might expand to:

http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&format=png&username=Roblox

Which gives Roblox's avatar.

rbxassetid[edit]

rbxassetid://assetId This points to a user-created asset on the site. It's much easier than typing out the entire URL, but also disallows finding things like assetVersionIds.

For example, this is a rbxassetid link that points to the justice decal by ROBLOX:

rbxassetid://29464013

And this is its URL equivalent:

http://www.roblox.com/asset/?id=29464013

http and https[edit]

This points to the exact location of something on the internet. It only works on ROBLOX-approved sites and will raise an error if used otherwise.

The only known approved websites are those that fall under the roblox.com domain.

Here is an example of finding an asset from gametest:

http://gametest.roblox.com/Asset?id=12223885

Referenced by