For example, in a Roblox sword if you click once is slashes, if you click twice it lunges. I wanted to know how to do this.
Here's my idea, but will it work, and is there a better way to do it?
tool = script.Parent
tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if tool.Clicked then --"Clicked" would be a bool value in the tool
print("He double clicked!")
tool.Clicked = false
elseif not tool.Clicked then
print("He only clicked once")
tool.Clicked = true
wait(0.5)
tool.Clicked = false
end
end)
end)

1 comment
try looking at the linked sword model in roblox and look at the script