📜  转移到 sprint roblox - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:22.693000             🧑  作者: Mango

代码示例1
-- Economic was incorrect :)
-- This is an actual working version I made myself editing Economic's.
-- I already know how to do this, anyway.
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")

UIS.InputBegan:Connect(function(Key)
    if Key.KeyCode == Enum.KeyCode.LeftShift or Key.KeyCode == Enum.KeyCode.RightShift then
        Humanoid.WalkSpeed = 16
    end
end)

UIS.InputEnded:Connect(function(Key)
    if Key.KeyCode == Enum.KeyCode.LeftShift or Key.KeyCode == Enum.KeyCode.RightShift then
        Humanoid.WalkSpeed = 6
    end
end)