I want to make a sprint button. I know how to bind keys but I don't know how to make the function stop when the sprint button (left shift) is no longer being held down.
For Client key down you should probably use UserInputService:
local user = game:GetService("UserInputService") if user:IsKeyDown(Enum.KeyCode.A) then repeat wait(1) print("Key A is down") until not user:IsKeyDown(Enum.KeyCode.A) --- Will repeat until the key is not down. end
Use a UserInputService and events InputBegan & InputEnded
Service: http://robloxdev.com/api-reference/class/UserInputService