Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Made by coolcapidog
- Channel ->> https://www.youtube.com/c/coolcapidog
- You can change the settings but you shouldn't change anything except settings.
- ]]
- local NormalWalkSpeed = 16
- local SprintSpeed = 25
- local CameraEffect = true
- local cas = game:GetService("ContextActionService")
- local Leftc = Enum.KeyCode.LeftControl
- local RightC = Enum.KeyCode.RightControl
- local player = game:GetService("Players").LocalPlayer
- local char = player.Character or player.CharacterAdded:Wait()
- local Humanoid = char:WaitForChild("Humanoid")
- local Camera = game.Workspace.CurrentCamera
- local TweenService = game:GetService("TweenService")
- local UIS = game:GetService("UserInputService")
- UIS.InputBegan:Connect(function(key, gameProcessed)
- if gameProcessed then return end
- if key.KeyCode == Enum.KeyCode.LeftShift then
- if CameraEffect == true then
- TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 90}):Play()
- end
- Humanoid.WalkSpeed = SprintSpeed
- end
- end)
- UIS.InputEnded:Connect(function(key, gameProcessed)
- if gameProcessed then return end
- if key.KeyCode == Enum.KeyCode.LeftShift then
- if CameraEffect == true then
- TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 70}):Play()
- end
- Humanoid.WalkSpeed = NormalWalkSpeed
- end
- end)
- --------------------------------------------------- Mobile Button
- local function handleContext(name, state, input)
- if state == Enum.UserInputState.Begin then
- if CameraEffect == true then
- TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 90}):Play()
- end
- Humanoid.WalkSpeed = SprintSpeed
- else
- if CameraEffect == true then
- TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 70}):Play()
- end
- Humanoid.WalkSpeed = NormalWalkSpeed
- end
- end
- cas:BindAction("Sprint", handleContext, true, Leftc, RightC)
- cas:SetPosition("Sprint", UDim2.new(.2, 0, .5, 0))
- cas:SetTitle("Sprint", "Sprint")
- cas:GetButton("Sprint").Size = UDim2.new(.3, 0, .3, 0)
Advertisement
Advertisement