/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/lua/lab-1141-005/main.lua
44 строки
1017 B
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
--!strict local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local NORMAL = 16 local SPRINT = 28 local function getHumanoid(): Humanoid? local character = player.Character if not character then return nil end return character:FindFirstChildOfClass("Humanoid") end UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if input.KeyCode == Enum.KeyCode.LeftShift then local hum = getHumanoid() if hum then hum.WalkSpeed = SPRINT end end end) UserInputService.InputEnded:Connect(function(input, _processed) if input.KeyCode == Enum.KeyCode.LeftShift then local hum = getHumanoid() if hum then hum.WalkSpeed = NORMAL end end end) player.CharacterAdded:Connect(function() local hum = getHumanoid() if hum then hum.WalkSpeed = NORMAL end end)