Script Issue. Sell point

Hey!
Nevermind i fixed it min ago -_-.
I tried creating sell point in my game.

It doesn’t work even if it has no buggs.

Is it because of decimal units?

local SellPoint = script.Parent
local debounce = false
SellPoint.Touched:Connect(function(hit)
	if not debounce then 
		debounce = true
	
	local character = hit.Parent
	local player = game.Players:GetPlayerFromCharacter(character)
	if player then
		player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + player.leaderstats.BlockCoins.Value / 100
		wait()
		player.leaderstats.BlockCoins.Value = player.leaderstats.BlockCoins.Value - player.leaderstats.BlockCoins.Value
		
	
	
		debounce = false
		
	
	end
	end
end)

local sellPoint = script.Parent

local debounce = false

sellPoint.Touched:Connect(function(hit)
if not debounce then
if hit.Parent:FindFirstChildOfClass(“Humanoid”) then
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)

  	if player then
  		debounce = true
  		
  		player.leaderstats.Coins.Value += player.leaderstats.BlockCoins.Value / 100
  		
  		task.wait()
  		
  		player.leaderstats.BlockCoins.Value -= player.leaderstats.BlockCoins.Value

  		task.wait()
  		
  		debounce = false --<<<<<<< Set the debounce back to false
  	end
  end

end
end)

1 Like

Tell me if it worked or not. So I can help.