I have a camera bobbing script when moving, I just need one for when it's idle. And yes, I took and edited the code from a different page on here. If your curious, I'm not making a TDM game. Maybe later. I've tried using an else, but that doesn't seem to work.
repeat wait(0.1) until game.Players.LocalPlayer local camera = game.Workspace.CurrentCamera local player = game.Players.LocalPlayer local character = player.Character local runservice = game:GetService("RunService") local lastTick = tick() local t = 0 local running = false character.Humanoid.Running:connect(function(speed) running = speed > 0 end) while true do runservice.RenderStepped:wait() local dt = tick()-lastTick if running then t = t+dt local look = camera.CoordinateFrame.lookVector camera.CoordinateFrame = CFrame.new(camera.CoordinateFrame.p, camera.CoordinateFrame.p+look) * CFrame.Angles(0, 0, math.rad(math.cos(t*6))) end lastTick = tick() end
This is my current code, and I'd prefer (not require) that whoever answers expand on this. Thanks!