While i was making a tycoon i ran into a bug that i know why its happening but i dont know how to fix it.
Whats happening is when the Specific part touches the Sell Part it Deletes the Part then give the player +5 Cash… but its not doing that exact part… Instead its working for a little then stops decting the Touch Event…
here is the Script
module.Sell = function(player, Folder)
local Time = time()
Folder.FirstFloor.SellPart.Touched:Connect(function(hit)
if hit:GetAttribute("Item") == "IsItem" then
if (time() - Time) > 1 then
Time = time()
player.PlayerFolder.ATMCASH.Value += hit:GetAttribute("Gain")
hit:Destroy()
end
end
end)
end
then heres a video of whats happening in the script.
im guessing the Debounce is not correct