This script should be working, I did everything as intended, but as soon as I tested it, it broke; it now says that it's Unable to cast value to Object
Here's where it errors out:
script.Parent.Process.MouseButton1Click:Connect(function() local id = script.Parent.Input.Text if game:GetService("MarketplaceService"):PlayerOwnsAsset(117099978, id) then local insert = game:GetService("InsertService"):LoadAsset(id)
You use PlayerOwnsAsset()
by doing PlayerOwnsAsset(player,assetId)
. You are using the player's UserId as the first argument, instead of the actual player.
What this error means though is that you are taking some type of data (UserId) and trying to use it in place of an Object (a player) .