(this is a local script that clones an item if you dont already have it)

I have this script that incapaz fixed for me but now I messed up in my own ways again. I tried to add a debounce because the item would clone again if you held the item while clicking on (it works in studio though) the surface gui, also the gear doesn't work, you can't activate it, the gear works when I put it in the starterpack but not when its cloned

(local script)

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local debounce = false

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.BackgroundTransparency = 0.9
wait(.1)
script.Parent.BackgroundTransparency = 0
    local arizona = game.ReplicatedStorage:WaitForChild("??????? ???")

    if player.Backpack:FindFirstChild(arizona.Name) then
	if not debounce then
		debounce = true
        print("already has")
        script.Parent.BackgroundTransparency = .7
        script.Parent.TextLabel.Visible = true
        wait(1)
        script.Parent.TextLabel.Visible = false
wait(.5)
debounce = false
end
    elseif not player.Backpack:FindFirstChild(arizona.Name) then
	if not debounce then
		debounce = true
	
        local clone = arizona:Clone()

        clone.Parent = player.Backpack
        script.Parent.BackgroundTransparency = .7
wait(.5)
debounce = false
end
    end
end)

2 comments

0

Add on the if of line 11: player.Character:FindFirstChild(arizona.Name)

0

add what?