Top.Mail.Ru
Ответы

Roblox studio бег

как сделать медленый шаг в роблокс студио а если нажать на ctrl можно бежать и так же наоборот

По дате
По рейтингу
Аватар пользователя
Ученик
4мес

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)

Аватар пользователя
Ученик
4мес

никак