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

why isn't LoadAsset() working?

Asked by 9 years ago

I'm making an installer plugin which can install any compatible kit, via use of LoadAsset(), and I'm running into a problem every time I give the plugin an asset id of a kit (in this case a test kit) I get the following error:

15:36:51.737 - Did you forget a colon? The first argument of member function LoadAsset must be an Object 15:36:51.740 - Script 'Plugin_287124029.Installer.InstallerGui.Script', Line 68 15:36:51.741 - Stack End

However the object browser says this:

Instance LoadAsset(int assetId) Member of InsertService Summary: Returns a Model containing the Instance that resides at AssetId on the web. This call will also yield the script until the model is returned. Script execution can still continue, however, if you use a coroutine.

Now my code looks like this:

local IS = game:getService("InsertService")
local MID = S_F:getText() -- S_F is a class that gets stuff for me
kit = IS.LoadAsset(MID)
-- the rest is checks for if it's really a kit

BTW: Can I use :IsA("int") to see if variable data is a int?

0
'LoadAsset' isn't a Property; It's a method. :P TheeDeathCaster 2368 — 9y
0
Yourrrrrrr right, that fixed the issue! But why was I getting that error in the first place, instead of just getting an error saying it's non-existent? chabad360 34 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

'LoadAsset' isn't a Property; It's a method. :P [2]

local IS = game:getService("InsertService")
local MID = S_F:getText() -- S_F is a class that gets stuff for me
kit = IS:LoadAsset(MID)
-- the rest is checks for if it's really a kit
Ad

Answer this question