Why doesn't this work?
Hello... I am making a GUI that uses InsertService:LoadAsset() to load Gear.
This is what the GUI looks like.
5 | [ TextBox ] IDAsset ( text box to put asset Id in ) |
---- HERE IS THE SOURCE FOR LOADER SCRIPT ----
03 | assetId = script.Parent.IDAsset.Text; |
04 | GetAsset = script.Parent.GetAsset.MouseButton 1 Click; |
05 | stat = script.Parent.Desc; |
08 | ser = game:GetService( 'InsertService' ) |
09 | ser:LoadAsset( tonumber (id)) |
11 | function show(parent,texttoshow,delay) |
12 | m = Instance.new( 'Message' , parent) |
17 | script.Parent.GetAsset.MouseButton 1 Click:connect( function () |
18 | if script.Parent.IDAsset.Text = = "" then |
19 | show(script.Parent.Parent.Parent, 'This is not a valid ID!' , 5 ) |
22 | script.Parent.GetAsset:Remove() |
23 | script.Parent.IDAsset:Remove() |
24 | script.Parent.credit:Remove() |
25 | print ' removed all others before anim ' |
27 | gui.stat.Text = '[ LOADING ASSET ]' |
28 | print ' changed to [loading asset] ' |
32 | print ( 'for loop...animation DOWN... loop# ' ..i.. '/7' ) |
33 | game.StarterGui.AssetGui.ASSETFRAME.Desc.Position = UDim 2. new( 0.25 , 0 , game.StarterGui.AssetGui.ASSETFRAME.Desc.Position.Y.Scale+ 0.05 , 0 ) |
36 | print ' before insert, after DOWN loop' |
37 | insert( tonumber (gui.assetId)); |
38 | print ( '[Note] assetId in gui looks like its ' ..gui.assetId) |
39 | ser = game:GetService( 'InsertService' ) |
40 | ser:LoadAsset( tonumber (gui.assetId)) |
41 | print 'done insert(tonumber(gui.assetId))' |
45 | print ( 'for loop... animation UP... loop# ' ..i.. '/7' ) |
46 | game.StarterGui.AssetGui.ASSETFRAME.Desc.Position = UDim 2. new( 0.25 , 0 , game.StarterGui.AssetGui.ASSETFRAME.Desc.Position.Y.Scale- 0.05 , 0 ) |
49 | game.ServerStorage.AssetGui.GetAsset:Clone().Parent = script.Parent |
50 | game.ServerStorage.AssetGui.IDAsset:Clone().Parent = script.Parent |
51 | game.ServerStorage.AssetGui.credit:Clone().Parent = script.Parent |
52 | print ' restoring others ' |
53 | gui.stat.Text = '[ ASSET ID: ]' |
54 | print 'changed back to [asset id]' |