Creating Double Shot system

Hello! I’ll keep this short and simple, I want to create a double shot system for my gun system however I dont really know where to start with this,I basically want it to shoot a second bullet if they have double clicked within 1-2 seconds else it will shoot the first bullet. If anyone could help me out that would be great! Thanks for reading :grinning_face_with_smiling_eyes:

local tool = Instance.new("Tool")
local tempTime = tick()

tool.Activated:Connect(function()
	print("Tool Activated!")
	
	if tick() - tempTime < 0.5 then --if tool is activated again in the next 0.5 seconds, do this
		print("Tool Activated Again!")
	end
	
	tempTime = tick()
end)
2 Likes

Wow I’ll look into this! Thank you for the help!

Question: would os.time() work as well?

I’m not sure, but you can most definitely try it!

1 Like

Hey I tried out your code today and it dosent seem to work that great, when you click once it prints both

1 Like

Try changing the “0.5” to “0.25” or lower perhaps. It seems a little too sensitive.
You could also add a click counter to make sure they actually clicked twice in a row and not multiple times at the same exact speed.

I messed with it a bit and was able to figure something out! Thank you so much for help!