I want to make a script in which after a player does not click twice in a specific time, it prints out s.
Heres what i tried.
local Time = tick()
mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:connect(function()
if tick() - Time < 6 then -- tick() - Time would be the time elapsed
print("double Click!")
else
print("s")
end
Time = tick()
end)
But this only prints when we click after the time is over. i want it to happen automatically.
After 6 seconds of a right click, i want it to print s without having the player click again/
I have literally no idea how to do this and help will be appreciated.
Ty
local Time = tick()
mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:Connect(function()
if tick() - Time < 6 then -- tick() - Time would be the time elapsed
print("double Click!")
end
Time = tick()
end)
while wait(1) do -- wait 1 second, 1/30th of a second no no
if tick() - Time < 6 then print("s") end
end