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

The Shift to sprint script is not working. Maybe I made a typo?

Asked by 5 years ago

Here is the Shift to sprint importer: function onPlayerEntered(player) repeat wait () until player.Character ~= nil local s = script.SprintScript:clone() s.Parent = player.Character s.Disabled = false player.CharacterAdded:connect(function (char) local s = script.SprintScript:clone() s.Parent = char s.Disabled = false
end) end

game.Players.PlayerAdded:connect(onPlayerEntered)

Then here is the shift to sprint local script that's inside the shift to sprint script:

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 = 25 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)

Maybe I made a typo I dont know

0
Please use lua blocks. Copy and pasting makes it much harder for us to read. Lugical 425 — 5y
0
Also keydown is depricated, use UserInputService ABK2017 406 — 5y
0
KeyDown is deprecated | connect is deprecated | use WaitForChild green271 635 — 5y
0
:Connect, :Disconnect should be used instead of :connect and :disconnect. Make sure that you use local in this case, as global functions/variables are a bad practice in most cases. Lugical 425 — 5y
View all comments (6 more)
0
How do I use lua blocks? massivegem45 -12 — 5y
0
On the question tab, there is a lua symbol. click it and paste ur code in there Lugical 425 — 5y
0
ok thanks massivegem45 -12 — 5y
0
Nice free model. User#19524 175 — 5y
0
thanks but the rest of my models are going to be on this account https://www.roblox.com/users/796673255/profile#!/about massivegem45 -12 — 5y
0
bruh you got that from the toolbox. btw put it in using lua blocks NotFrindow 346 — 4y

Answer this question