I don't understand InsertService yet and i was wondering if it wasn't working because of the script its in? Its in a normal script not local or module was it suppose to?

Here's the script.

player = game.Players.LocalPlayer
money = player.leaderstats.Cash
price = 100
asset = 5584289694
model = game:GetService("InsertService"):LoadAsset(asset)
model:MakeJoints()
model.Name = "Webley Mk VI"

function buy()
if money.Value >= price then
money.Value = money.Value - price
local a = model:clone()
a.Parent = player.Backpack
local b = model:clone()
b.Parent = player.StarterGear

end
end
script.Parent.MouseButton1Down:connect(buy)

4 comments

0

I believe it means you have to use the server to insert assets. You need to use remote events.

0

Couldn't you just insert the asset in studio, put it into replicatedstorage, and then clone it when you buy the item?

0

@TTChaos no ii couldnt bc the when the script in the guns run they need a character to be in. And ive already tried it.

0

@Dovydas ok ill tyr that