Advertisement
Animescapetower

LoadAsset

Jan 14th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. --Note : Using this in a FE Game may not work, This should work only in script builders only if they use a require or a FE Converter
  2. -- Made by Animescapetower--
  3. InsertService = game:GetService("InsertService")
  4. LoadAsset = function(AssetType,AssetID) -- AssetType[TYPE OF ASSET], AssetID[ID OF ASSET]
  5.    local Asset = InsertService:LoadAsset(AssetID) -- Asset
  6.    if AssetID == 0 or AssetID == nil then-- If no assetid or the assetid is 0 then the asset can not work, it may result in a error.
  7.       else
  8.       if AssetType == "Sound" or AssetType == "Model" or AssetType == "Decal" or AssetType == "Mesh" or AssetType == "All" then
  9.          Asset.Parent = workspace
  10.       end
  11.    end
  12.    return Asset
  13. end
  14.  
  15. local ID = 0
  16.  
  17. LoadAsset("All",ID) -- runs function
  18.  
  19. _G.LoadAsset = LoadAsset -- Easily can get load asset function using the output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement