The title of the topic kinda explains what im trying to do.
I want the player to hold the left mouse button 2 sec. In my current script, it wont print the third print statement:
local HOLD_TIME = 2
local currentTime = os.time()
local RunService = game:GetService('RunService')
local canThrow = false
mouse.Button1Down:Connect(function()
if isEquipped() then
canThrow = true
currentTime = os.time()
print("Can throw")
end
end)
mouse.Button1Up:Connect(function()
if canThrow then
print("Nu die ene lijnen")
if currentTime - os.time() >= HOLD_TIME then
local camPos = workspace.CurrentCamera.CFrame.Position
local direction = (mouse.Origin.Position - camPos).Unit
tool.Throw:FireServer(mouse.Hit.Position, direction)
print("throw") -- this wont run
end
end
end)
this is a snippet of my code