My items won't destroy and i don't get any money, how do I do?
I am making a fishing simulator where you get your fish in your inventory, but it won't delete my fish when I touch my sell part, and nor will it give me money(Coins) Btw this is a local script in my sell part.
Here is my code:
01 | local plr = game.Players.LocalPlayer |
03 | local plrBackpack = plr.Backpack |
05 | local part = script.Parent |
07 | part.Touched:Connect( function (hit) |
09 | local coinsValue = plr.leaderstats.Coins.Value |
11 | if not hit:IsDescendantOf(plr.Character) then return end |
13 | for _, Fish in pairs (plrBackpack:GetChildren()) do |
15 | if Fish.Name = = 'Faceless fish' then |