нужно создать локальный скрипт (LocalScript) и перенести его в StarterCharacterScripts. скрипт напишу ниже.
local NormalWalkSpeed = 20
local SprintSpeed = 30
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(5)
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(Run, 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("Run", handleContext, true, Leftc, RightC)
cas:SetPosition("Run",
UDim2.new (.2, 0, .5, 0))
cas:SetTitle("Run", "Run")
cas:GetButton("Run").Size =
UDim2.new (.3, 0, .3, 0)
Script by KittenDivinity