Alright so i have a script to stare at a broken watch on button press, it is toggleable
local script btw
I don’t really know where to even start on this but staring at the watch for 10 minutes will give you a badge
how can i script a timer that will reset when i put the watch down
line 21 is putting the watch down and line 15 is putting it up
local character = script.Parent.Parent.Parent
local part = script.Parent
local seat = part.Animation
local input = game:GetService("UserInputService")
local animator = character.Humanoid:WaitForChild("Animator")
local a = animator:LoadAnimation(seat)
local plr = game.Players:GetPlayerFromCharacter(character)
mouse = plr:GetMouse()
local isdo = false
mouse.KeyDown:connect(function(key)
if key == "q" then
if isdo == false then
a:Play()
isdo = true
game.Lighting.DepthOfField.Enabled = true
elseif isdo == true then
a:Stop()
isdo = false
game.Lighting.DepthOfField.Enabled = false
end
end
end)
local animator = character.Humanoid:WaitForChild("Animator")
local a = animator:LoadAnimation(seat)
local plr = game.Players:GetPlayerFromCharacter(character)
mouse = plr:GetMouse()
local isdo = false
mouse.KeyDown:connect(function(key)
if key == "q" then
if isdo == false then
a:Play()
isdo = true
game.Lighting.DepthOfField.Enabled = true
-- // Time counter
local startTime = os.clock()
while true do
-- // Check if player pressing Q again.
if isdo == false then
break
end
-- // 600 seconds = 10 minutes
if os.clock() - startTime >= 600 then
-- // Give player badge or something.
break
end
wait()
end
elseif isdo == true then
a:Stop()
isdo = false
game.Lighting.DepthOfField.Enabled = false
end
end
end)