that is just annoying. something worth mentioning is that the first time OnCams is set to true literally nothing happens which makes it work in reverse somehow.
local CamsDebounce = false --//stupid camera hover thing
local OnCams = workspace.Technical.OnCams
local function CameraToggle() --//function instead so you can force the cameras down
if OnCams.Value == false then
OnCams.Value = true
game.ReplicatedStorage.Values.MouseLook.Value = false
game.ReplicatedStorage.Values.Power.Usage.Value = game.ReplicatedStorage.Values.Power.Usage.Value + 0.2
game.Workspace.FX.Camera:Play()
script.Parent.Parent.CameraFrame.Visible = true
game.Workspace.CurrentCamera.CFrame = game.Workspace.Cameras.Security.Cam01.CFrame
script.Parent.Parent.Noise.Visible = true
else
OnCams.Value = false
game.ReplicatedStorage.Values.MouseLook.Value = true
game.ReplicatedStorage.Values.Power.Usage.Value = game.ReplicatedStorage.Values.Power.Usage.Value - 0.2
game.Workspace.FX.Camera:Play()
script.Parent.Parent.CameraFrame.Visible = false
game.Workspace.CurrentCamera.CFrame = game.Workspace.Cameras.OfficeCamera.CFrame
script.Parent.Parent.Noise.Visible = false
end
end
OnCams.Changed:Connect(CameraToggle)
script.Parent.MouseEnter:Connect(function()
if not CamsDebounce then
CamsDebounce = true
task.delay(0.3, function()
CamsDebounce = false
end)
if OnCams.Value == false then
OnCams.Value = true
else
OnCams.Value = false
end
end
end)
--//debug thingy
--task.spawn(function()
-- while task.wait() do
-- print(CamsDebounce)
-- end
--end)