✓ Accepted answer
If you made this script, then just use UserInputService's InputEnded event. This event fires whenever the input service is not active anymore, in your case, when the left control key is not held down anymore. I also the gameProcessed parameter so your player's walk speed doesn't change when the player is typing.
local player = game.Players.LocalPlayer
local humanoid = player.Character.Humanoid
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input,gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
humanoid.WalkSpeed = 35
end
end)
UIS.InputBegan:Connect(function(input,gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
humanoid.WalkSpeed = 16
end
end)
3 comments
they both say InputBegan
Thanks it works now!
My bad. On line 13 you should change InputBegan to InputEnded