I have a working shift to sprint script and it sets the sprint speed to a certain digit when sift is pressed and sets it back to 16 when let go of.
But the problem is that it is colliding with one of my other script where the player is not allowed to move for a while: script.Parent.Touched....ect local h = ...Humanoid h.JumpPower = 0 h.WalkSpeed = 0
But you can just get out of this by clicking shift.
My sprint script is:
local mouse = game.Players.LocalPlayer:GetMouse() local running = false local S = script.Parent.Parent.Character.Humanoid.Walkspeed
function getTool() for _, kid in ipairs(script.Parent:GetChildren()) do if kid.className == "Tool" then return kid end end return nil end
mouse.KeyDown:connect(function (key) -- Run function key = string.lower(key) if string.byte(key) == 48 then running = true local keyConnection = mouse.KeyUp:connect(function (key) if string.byte(key) == 48 then running = false end end) for i = 1,5 do game.Workspace.CurrentCamera.FieldOfView = (70+(i2)) wait() end game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 24 --I want to multiply here repeat wait () until running == false keyConnection:disconnect() game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 --And divide here for i = 1,5 do game.Workspace.CurrentCamera.FieldOfView = (80-(i2)) wait() end end end)
Can anyone help me with this. I've tried using a local value of S and multiplying that but it doesn't seem to work.

1 comment
Use code block, I can't read your code