Last active
February 18, 2022 01:08
-
-
Save R0bl0x10501050/a0cc016ef3f920732be5ce2d88be4f81 to your computer and use it in GitHub Desktop.
Immersive sprint experience in Roblox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--// 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks good!