Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my ProximityPrompt count as two triggers?

Asked by 3 years ago

For some reason this ProximityPrompt counts as two triggers when I activate it. I even tried adding a debounce but that still didn't work. (I added pets as an example)

script.Parent.ObjectText = "Tame this "..script.Parent.Parent.Parent.Name
local debounce = false

script.Parent.Triggered:Connect(function(plr)
    if (plr.Character:FindFirstChild("Capture Disc")) then
        if debounce == false then
            debounce = true
            game.ReplicatedStorage.Pet:FireClient(plr,script.Parent.Parent.Parent.loomian)
            script.Parent.Parent.Parent.Parent = game.ReplicatedStorage.Pets        
            print("gotten")
            wait(1)
            debounce = false
        end
    end
end)

Answer this question