LoadAsset (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy
added/formatted
>Camoy
fixed
Line 1: Line 1:
{|
<onlyinclude>{{Method|name = LoadAsset
|<onlyinclude>{{Method|name = LoadAsset
|arguments = [[number]] AssetId
|arguments = [[number]] AssetId
|returns = [[Model]]
|returns = [[Model]]
|description = Returns a model in the [[InsertService]] containing the loaded asset.
|description = Returns a model in the [[InsertService]] containing the loaded asset.
|object = [[InsertService]]
|object = [[InsertService]]
|}}</onlyinclude>
}}</onlyinclude>
|}
{{clear floats}}
{{Example|<pre>
{{Example|<pre>
game:GetService("InsertService"):LoadAsset(AssetId).Parent = game.Workspace
game:GetService("InsertService"):LoadAsset(AssetId).Parent = game.Workspace
Line 20: Line 19:
*[[GetCollection_(Function)|GetCollection]]
*[[GetCollection_(Function)|GetCollection]]
*[[Insert_(Function)|Insert]]
*[[Insert_(Function)|Insert]]
[[Category:Methods]]

Revision as of 16:03, 30 August 2010

LoadAsset( number AssetId )
Returns Model
Description: Returns a model in the InsertService containing the loaded asset.
Member of: [[RBX.lua.InsertService (Object)|InsertService]]
Example
game:GetService("InsertService"):LoadAsset(AssetId).Parent = game.Workspace


Limitations

  • Some scripts are deleted from loaded models. Presumably this is to stop viruses.
  • LoadAsset cannot be used offline (in Studio Play or Studio Start Server/Start Player).
  • Model must be public domain if loaded from a Server-side script.
  • Model must be public domain or owned by player for a Local script.

See Also