[SOLVED]Hello , I wanted to make a script that prevents Tool Duplicates but everytime its says : Argument 1 missing or nil

Hello , I wanted to make a script that prevents Tool Duplicates but everytime its says : Argument 1 missing or nil , I have no clue why it says that , I tried re-writting the script but no success everytime it gives me the same error message at Line 12




local proximityprompt = script.Parent:WaitForChild("ProximityPrompt") 
local ToolGiven = "Art"


local ToolLol = game.Lighting:FindFirstChild("Art")


proximityprompt.Triggered:Connect(function(player)	
	--local playerBackpackTool = player.Backpack:FindFirstChild(ToolGiven.Name) or player.Character:FindFirstChild(ToolGiven.Name)	
	if player.Backpack then
		local find = ToolLol
		if ToolLol and not player.Backpack:FindFirstChild(ToolGiven.Name) then
			local find_clone = find:Clone()
			find_clone.Parent = player.Backpack
			--script.Parent.Parent:Destroy()
			--game.Lighting.IT1:clone().Parent = game.Workspace
		else if player.Backpack:FindFirstChild(ToolGiven.Name) then
			
				print("No")
			end
		end
	end
end)
1 Like

ToolGiven is a string. You can’t do ToolGiven.Name because ToolGiven IS the name. Just remove the .Name from the else if statement on that line