Tool Clone:() Resources

Tool Clone
local Prox = yourproximityprompt
local Tool = yourtool

Prox.Triggered:Connect(function(player)
	if player.Backpack:FindFirstChild("Tool") then --  change "tool" to your tool name
		return true
	elseif player.Character:FindFirstChild("Tool") then --  change "tool" to your tool name
		return true
	else
		Tool:Clone().Parent = player.Backpack
	end
end)

Give Like To This Post

When does the Boolean change?
Limits

Well anyways this should be your code for line 6 and 7:

if toolduplicates ~= true then
    toolduplicates = true
    z:Clone().Parent = y

Try deleting the else on line 11. Also, I would suggest removing lines 6-8. Check if the player has the tool equipped by changing line 9 to if x.Character:FindFirstChild(toolname) and x.Backpack:FindFirstChild(toolname) == nil then

local Prox = yourproximityprompt
local Tool = yourtool

Prox.Triggered:Connect(function(player)
	if player.Backpack:FindFirstChild("Tool") then --  change "tool" to your tool name
		return true
	elseif player.Character:FindFirstChild("Tool") then --  change "tool" to your tool name
		return true
	else
		Tool:Clone().Parent = player.Backpack
	end
end)

should work I tested it

1 Like