#How do I make double sprint?

1 messages · Page 1 of 1 (latest)

plain birch
#

It's an open world RPG game. The idea is that after the initial sprint, if the player presses shift again. They enter an even faster travel mode.

lavish solarBOT
#

studio** You are now Level 1! **studio

real temple
#

RunSpeed = 0
use UserInputService.InputBegan(Input, GP)
if GP then return end
if Input.KeyCode == Enum.Keycode.LShift then
RunSpeed += 1
if RunSpeed > 2 then
RunSpeed = 0
end
end
end

#

I type in discord so idk if I typed everything correctly

#

lemme do it in roblox studio brb

#
local UIS = game:GetService("UserInputService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

local SprintState = 0

local Speed = {
    
    [0] = 8,
    [1] = 12,
    [2] = 16,
    
}

local function IncreaseSprint()
    
    SprintState += 1
    
    if SprintState > 2 then
        
        SprintState = 0
        
    end
    
end


UIS.InputBegan:Connect(function(Input, GP)
    
    if GP then return end
    
    if Input.KeyCode == Enum.KeyCode.LeftShift then
        
        IncreaseSprint()
        Humanoid.WalkSpeed = Speed[SprintState]
        
    end
    
end)```
real temple
#

like [0] = 12 -- faster

#

or [2] = 64 -- very fast lol

#

you can also hook this up with tweenservice to change the fov to make it seem more fast

plain birch