here is my code :
local debounce = true
script.Parent.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local char = hit.Parent
local player = game.Players:GetPlayerFromCharacter(char)
--//------------------------------------------------------------------------------------------------------------------------------------------\\--
print("Sold!")
debounce = false
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + player.Knowledge.Value
player.Knowledge.Value = 0
wait(1)
debounce = true
end
end
end)

1 comment
no