How can I make a tool giver that detects the player's backpack and only give a tool to the player only if the player does not have the tool? If the player have the tool, the tool giver will not give the player the tool.
Here's the code that gives the player the tool multiple times:
function boop(Player)
if not Player.Backpack:FindFirstChild(Gun) then
local Tool = game.Lighting[Gun]:clone()
Tool.Parent = Player.Backpack
end
end
script.Parent.ClickDetector.MouseClick:Connect(boop)

4 comments
Where is your code for the giver?
Oh, I have put it inside already
Is Toolname a variable that is already defined?
Yes