Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Put this in a local script in StarterGUI
- local UIS = game:GetService("UserInputService")
- local DefaultFOV = 70
- local lastTime = tick()
- local char = game:GetService("Players").LocalPlayer.Character
- local hum = char:WaitForChild("Humanoid")
- UIS.InputBegan:Connect(function(input,gameprocessed)
- if input.KeyCode == Enum.KeyCode.W then
- local now = tick()
- local difference = (now - lastTime)
- if difference <= 0.5 then
- if hum.WalkSpeed < 11 then
- print("running")
- hum.WalkSpeed = 18
- local properties = {FieldOfView = DefaultFOV + 15}
- local Info = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
- local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera,Info,properties)
- T:Play()
- end
- end
- lastTime = tick()
- end
- end)
- UIS.InputEnded:Connect(function(input,gameprocessed)
- if input.KeyCode == Enum.KeyCode.W then
- print("running")
- hum.WalkSpeed = 32
- local properties = {FieldOfView = DefaultFOV}
- local Info = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
- local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera,Info,properties)
- T:Play()
- end
- end)
- hum.Died:Connect(function()
- game.Workspace.Camera.FieldOfView = DefaultFOV
- hum.WalkSpeed = 16
- script.Disabled = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment