this is a bit of code i tried and it worked (i got the item) but it didnt takeaway money can anyone help?
function Give(x)
local y = x.Backpack
local z = game.Lighting["Octopus"]
z:Clone().Parent = y
end
script.Parent.ClickDetector.MouseClick:connect(Give)

1 comment
It's because you never programmed it to do so. Access the Player's leaderstats via the Player pointer passed from MouseClick, modify the respective stat. Please also use ReplicatedStorage to store Instances. ROBLOX methods now follow title-case, please use :Connect().