I tried to combine minecraft sprint script and shift sprint script but there's a problem. It screws up my walkspeed and the camera's field of view when i did both double tapping w and holding shift and release w before releasing shift.
I've removed the animations the script gave me, renamed the variables and added more conditions to separate both functions but it doesn't seem to work.
It'l be nice if someone can fix it.
And here's the script:
local mouse = game.Players.LocalPlayer:GetMouse()
local wrunning = false
local shiftrunning = false
local s = ""
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if (key == "w" or key == "") and string.byte(key) ~= 48 then
s = s.."w"
delay(0.2,function ()
if s ~= "ww" then
s = ""
end
end)
if s == "ww" then
s = ""
wrunning = true
local wkeyConnection = mouse.KeyUp:connect(function (key)
if key == "w" or key == "" then
wrunning = false
end
end)
local fov = game.Workspace.CurrentCamera.FieldOfView
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (fov+(i*2))
wait()
end
local walkspeed = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = walkspeed +8
repeat wait () until wrunning == false
wkeyConnection:disconnect()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = walkspeed
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (fov+10-(i*2))
wait()
end
end
end
if string.byte(key) == 48 and key ~= "w" then
shiftrunning = true
local shiftkeyConnection = mouse.KeyUp:connect(function (key)
if string.byte(key) == 48 then
shiftrunning = false
end
end)
local fov = game.Workspace.CurrentCamera.FieldOfView
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (fov+(i*2))
wait()
end
local walkspeed = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = walkspeed + 8
repeat wait () until shiftrunning == false
shiftkeyConnection:disconnect()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = walkspeed
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (fov+10-(i*2))
wait()
end
end
end)
Thanks.

1 comment
This doesn't work for me. And I couldn't see what's problem this script has. The output said nothing.