When I keep testing the tool out, it keeps giving me two tools. It also keeps making others not have it when I get two tools in the giver. This is the script:

local debounce = false

function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end 
end
return nil 
end
hint = Instance.new("Hint")
function onTouch(part)

local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then

debounce = true
hint.Parent = game.Workspace
hint.Text = ""
local player = getPlayer(human)

if (player == nil) then return end

script.Parent:FindFirstChild("PumpkinBucket"):clone().Parent = player.Backpack -- Change "TOOL" with the name of your tool

wait(2) ---the time in which the tool can be gave again
debounce = false
hint.Parent = nil
end
end


script.Parent.Touched:connect(onTouch)

1 comment

0

It already only gives one tool.