Hey, I am trying to figure out how to get this tool to stop giving to players once they already have one so that they can' t have a lot. I am using this script to give the tool, how would I do this?
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
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
script.Parent:clone().Parent = player.Backpack
wait(2)
debounce = false
end
end
script.Parent.Parent.Touched:connect(onTouch)
I am trying to make it so that it stops giving to players who have it, and keep giving to players that don't have it. Is this possible??

3 comments
Thank you, works perfectly.
no problem! :)
Thank you and I fixed the problem about the shop