RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Make me a running system for when the player presses ctrl it toggles running and makes them faster"
-- local script local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local running = false local speed = 16 local sprintSpeed = 32 local function toggleRunning() running = not running if running then speed = sprintSpeed else speed = 16 end end humanoid.Running:Connect(function(speed) if running then humanoid.WalkSpeed = sprintSpeed else humanoid.WalkSpeed = 16 end end) game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed) if not gameProcessed and input.KeyCode == Enum.KeyCode.LeftControl then toggleRunning() end end)