I've made a sprinting script when you press 'q', you sprint. Your camera also zooms out a little. But when you rapidly press 'q' the camera looks bad. How would i go about making it look smother?
here is the script:
mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(key)
if key == "q" then
script.Parent:TweenSize(UDim2.new(0,100,0,50),"InOut","Quad",2,true)
script.Parent:TweenSize(UDim2.new(1,100,0,50),"InOut","Quad",6,false)
wait()
script.Parent.BackgroundColor3 = Color3.new(0,0,1)
if game.Workspace.CurrentCamera.FieldOfView ~= 80 then
for i = 70,80,1 do
game:GetService("RunService").RenderStepped:wait()
game.Workspace.CurrentCamera.FieldOfView = i
end
end
end
end)
mouse.KeyUp:connect(function(key)
if key == "q" then
script.Parent.BackgroundColor3 = Color3.new(0,1,0)
script.Parent:TweenSize(UDim2.new(1,100,0,50),"InOut","Quad",6,true)
script.Parent:TweenSize(UDim2.new(0,100,0,50),"InOut","Quad",2,false)
if game.Workspace.CurrentCamera.FieldOfView ~= 70 then
for i = 80,70,-1 do
game:GetService("RunService").RenderStepped:wait()
game.Workspace.CurrentCamera.FieldOfView = i
end
end
end
end)
here is the game so you see what it looks like:

2 comments
The Sprint is amazing. The people who keep pressing Q are just noobs who want unlimited sprint. It's good as is. Keep it up, and oh, I like that counter that keeps going up the higher you get.
Thanks!