local Part = script.Parent 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.Money local Selling = leaderstats.Backpack if Selling.Value > 0 then Currency.Value = Currency.Value + Selling.Value *1 Selling.Value = 0 end end end end)
change line 5 to this
local player = game.Players:WaitForChild(HIT.Parent)
Try a debounce system https://developer.roblox.com/en-us/articles/Debounce
--Code by roblox function debounce(func) local isRunning = false -- Create a local debounce variable return function(...) -- Return a new function if not isRunning then isRunning = true func(...) -- Call it with the original arguments isRunning = false end end end