Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Sprint and Speed Coil Walkspeed Problem Please help?

Asked by 6 years ago
Edited 6 years ago

Hello, I have a script where if you hold shift you run, it works great but when I equipt a speed coil then hold shift it returns back to normal speed.. This is really bugging me and can't find a fix, please help, Thanks

This is the script to sprint

local mouse = game.Players.LocalPlayer:GetMouse() local running = false

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 = 16 * 1.22 -- Change To Any Higgher Number To Go Faster repeat wait () until running == false keyConnection:disconnect() game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 for i = 1,5 do game.Workspace.CurrentCamera.FieldOfView = (80-(i2)) wait() end end end)

1
USE A CODE BLOCK hiimgoodpack 2009 — 6y
0
I agree NegativeNil 0 — 6y
0
Hey, killerfish95. We do recommend using a codeblock to sort out your script, this is very,very, and quite complicated to understand specially having lines of codes mixing up into 1 line. Tolstoii 15 — 6y

Answer this question