Alright in workspace insert a script (not local)like this
01 | function onPlayerEntered(player) |
02 | repeat wait () until player.Character ~ = nil |
03 | local s = script.SprintScript:clone() |
04 | s.Parent = player.Character |
06 | player.CharacterAdded:connect( function (char) |
07 | local s = script.SprintScript:clone() |
13 | game.Players.PlayerAdded:connect(onPlayerEntered) |
Insert another script inside that one not the code but insert new script inside that one so the script becomes that scripts child and make sure its a local script
01 | local mouse = game.Players.LocalPlayer:GetMouse() |
05 | for _, kid in ipairs (script.Parent:GetChildren()) do |
06 | if kid.className = = "Tool" then return kid end |
12 | mouse.KeyDown:connect( function (key) |
13 | key = string.lower(key) |
14 | if string.byte(key) = = 48 then |
16 | local keyConnection = mouse.KeyUp:connect( function (key) |
17 | if string.byte(key) = = 48 then |
22 | game.Workspace.CurrentCamera.FieldOfView = ( 70 +(i* 2 )) |
25 | game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 24 |
26 | repeat wait () until running = = false |
27 | keyConnection:disconnect() |
28 | game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 |
30 | game.Workspace.CurrentCamera.FieldOfView = ( 80 -(i* 2 )) |