Need Help With Arrow Script

Ahoy! So what the code is supposed to do is when the player clicks with the tool equipped, an arrow is welded to their hand then it will disappear. The only problem is that the arrow would only appear once, if the tool is clicked again, the arrow will not be there. Also if the tool is unequipped and re equipped its not there either. This code is in a local script inside of the bow and arrow tool.

Here is the code:

debounce = true
	

script.Parent.Equipped:Connect(function(Mouse)
	debounce = true

	Mouse.Button1Down:Connect(function()
		if debounce == true then
			local Character = game.Players.LocalPlayer.Character
			
	local arrow = game.ReplicatedStorage.Arrow
	arrow.Transparency = 0
			arrow:Clone()
			arrow.Transparency = 0
			arrow.Parent = workspace
		script.Parent.Weld.Part0 = arrow
		script.Parent.Weld.Part1 = Character["Left Arm"]
		script.Parent.Weld.C0 = CFrame.new(-0.5,0,2)
		script.Parent.Weld.C0 = script.Parent.Weld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(90),math.rad(30),0)
			debounce = false
			wait(1)
			arrow.Transparency = 1
			debounce = true
			
		end
		
	end)
end)

script.Parent.Unequipped:Connect(function()


end)

Help would be appreciated!

1 Like

Can’t you just have another variable at the top with the debounce ? It start as false and as soon at you use the tool it become true forever and then you use a if statement in your script to check when he try to use it. And to be honest if you can only use that tool once the debounce is useless so it may become the variable I just said