Try replacing your function for the camera with this:
local debounce = true;
function camera()
if debounce then
cam.CFrame = camPart.CFrame * CFrame.Angles(
math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
0
)
else
game:GetService("RunService").RenderStepped:Disconnect(camera);
debounce = true;
end
end
game:GetService("RunService").RenderStepped:Connect(camera);
and adding debounce = false
to the start of the function I gave you earlier (client-side). If you want to rerun the camera script with this setup, youâll, of course, have to reconnect the function.
Youâd want to put âdebounce = falseâ inside of the function, so after the line game.ReplicatedStorage.CameraEvent.OnClientEvent:Connect(function()
.
Also, on the line after the else
statement, âDisconnectâ is spelled as âDisonnectâ. I fixed the spelling in my original post, you should be able to just copy it over and replace it agiaan.
okgodosufiuihfoidhwa IT WORKSSSSS TYSM
1 Like