Skip to content

Instantly share code, notes, and snippets.

@R0bl0x10501050
Last active February 18, 2022 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save R0bl0x10501050/a0cc016ef3f920732be5ce2d88be4f81 to your computer and use it in GitHub Desktop.
Save R0bl0x10501050/a0cc016ef3f920732be5ce2d88be4f81 to your computer and use it in GitHub Desktop.
Immersive sprint experience in Roblox
--// Written By: R0bl0x10501050
-- -- -- -- -- -- -- -- -- --
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
TS:Create(workspace.CurrentCamera, TweenInfo.new(0.75), {FieldOfView = 85}):Play()
TS:Create(plr.Character.Humanoid, TweenInfo.new(0.75), {WalkSpeed = 32}):Play()
TS:Create(plr.Character.Humanoid, TweenInfo.new(0.75), {JumpPower = 75}):Play()
TS:Create(plr.Character.HumanoidRootPart.Running, TweenInfo.new(0.75), {PlaybackSpeed = 3.7}):Play()
end
end
end)
UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
TS:Create(workspace.CurrentCamera, TweenInfo.new(0.75), {FieldOfView = 70}):Play()
TS:Create(plr.Character.Humanoid, TweenInfo.new(0.75), {WalkSpeed = 16}):Play()
TS:Create(plr.Character.Humanoid, TweenInfo.new(0.75), {JumpPower = 50}):Play()
TS:Create(plr.Character.HumanoidRootPart.Running, TweenInfo.new(0.75), {PlaybackSpeed = 1.85}):Play()
end
end
end)
@bloodball
Copy link

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment