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

InsertService cannot be used to load assets from the client?

Asked by
danglt 185
6 years ago

When i use this it gives me the error InsertService cannot be used to load assets from the client

player = game.Players.LocalPlayer

game:GetService("InsertService"):LoadAsset(212641536):GetChildren()[1].Parent = player.Backpack

another thing to mention this is being used in a gui full script below

local GamePassService = game:GetService('GamePassService')
local PlayersService = game:GetService('Players')


local ID = 3265754

local player = game.Players.LocalPlayer
script.Parent.Parent.MouseButton1Click:Connect(function()
    if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, ID) then
        game:GetService("InsertService"):LoadAsset(212641536):GetChildren()[1].Parent = player.Backpack
    else game:GetService("MarketplaceService"):PromptPurchase(player, ID)
    end
end)
0
Big duh. You cannot load assets from the client for obvious reasons. Amiaa16 3227 — 6y

1 answer

Log in to vote
2
Answered by 6 years ago
Edited 6 years ago

This was answered already, but to sum it up, It means that you can not use Insert Service on the client (in a local script) for most methods such as 'Load Asset' due to exploiters and their ability to load arbitrary assets. You must use remote events to ask the server to pass an Instance of it to the client. To find out more information, here is the post that made this new decision public, and also provided an example.

Ad

Answer this question