Error: Argument 1 missing or nil
Stack Begin
Script 'Workspace.Sell Model.Sell.Part.Script', Line 16
Stack End
local Part = script.Parent
local plr = game.Players.LocalPlayer
local ID = 7697627
Part.Touched:Connect(function(HIT)
local H = HIT.Parent:FindFirstChild("Humanoid")
if H then
local player = game.Players:GetPlayerFromCharacter(HIT.Parent)
if player then
local leaderstats = player:WaitForChild("leaderstats")
local Currency = leaderstats.Coins
local Selling = leaderstats.Clicks
if Selling.Value > 0 then
Currency.Value = Currency.Value + Selling.Value *1
Selling.Value = 0
if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr, ID) then
Currency.Value = Currency.Value + Selling.Value *2
script.Parent.Coins:Play()
end
end
end
end
end)
