So I am making a fishing simulator game, and when I try to remove items from a player and give them in-game currency, it won't do either.
Here is my code:
local plr = game.Players.LocalPlayer
local plrBackpack = plr.Backpack
local sellPart = script.Parent
sellPart.Touched:Connect(function(hit))
local money = plr.leaderstats.Coins.Value
if not hit:IsDescendantOf(plr.Character) then return end
local allFish = plrBackpack:GetChildren()
for _, Fish in pairs(allFish) do
if Fish.Name == 'Faceless fish' then
allFish:Destroy()
money = money + 5
end
end
end)
