I have a SpiderMan Physics game and when shooting my web onto floating blocks in the sky, it shoots multiple webs if I spam click. The debounce does not seem to work. I am wanting to have it to where you click and then it waits .5 seconds before you can click again
LocalScript
local Clicked = false
Mouse.Button1Down:Connect(function()
if Clicked == false and Mouse.Target ~= nil and Character:FindFirstChild('LeftHand') then -- when they click,
local Pos = Mouse.Hit.p
local Request = 'ShootWeb'
ShootWeb:FireServer(Request,Pos) -- ..it shoots the web
wait(.5)
Clicked = true
elseif Clicked == true then
local Request = 'RemoveWeb'
RemoveWeb:FireServer(Request)
wait(.5)
Clicked = false
end
end)
ServerScript
ShootWeb.OnServerEvent:Connect(function(Player,Request,MousePos)
if Request == 'ShootWeb' then
-- code below can be ignored
local Part = Instance.new('Part',workspace.AttatchmentParts)
Part.Name = Player.Name
Part.Size = Vector3.new(1,1,1)
Part.Transparency = 1
Part.Anchored = true
Part.CanCollide = false
Part.CFrame = CFrame.new(MousePos)
local Att0 = Instance.new('Attachment',Player.Character.LeftHand)
local Att1 = Instance.new('Attachment',Part)
Rope = Instance.new('RopeConstraint',Player.Character.LeftHand)
Rope.Color = BrickColor.new('Institutional white')
Rope.Visible = true
Rope.Length = (Player.Character.LeftHand.Position - Part.Position).magnitude
Rope.Attachment0 = Att0
Rope.Attachment1 = Att1
end
end)
Help would be greatly appreciated!

4 comments
well assuming u put the debounce local canshootweb = true right before the if statement it might just get back to true the whole time? test it with a print
The script is kinda messy, a lot of undefined variables. Maybe you can clear it up?
try placing a print on --code for shooting web
Try placing the Clicked = true before the fire server.