How can I make the player faster if they have a gamepass?
The parent is a script called"SprintScript Importer":
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) |
The child is a local script call "SprintScript":
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 = 30 |
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 )) |