I have this script, but it will give the same player the tool they already have after 0.5 seconds, how do I make it so that the script can detect a player who already has a tool so that way it doesn't give them the tool again?
local debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Humanoid then
if debounce == true then return end
debounce = true
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local gravity = game.ReplicatedStorage.ClassicSword:Clone()
gravity.Parent = plr.Backpack
wait(0.5)
debounce = false
end
end)

2 comments
i cant give advice but not an answer, maybe try making a variable like got = game.StarterPack.toolname and then getting it to run an else if?
Check to see if the tool exists using if backpack:FindFirstChild(toolname) then