-
What do you want to achieve? Keep it simple and clear!
I’m trying to achieve a sprint system, similar to other games found on roblox, like Track & Field Infinite, Prilda’s track and field, etc. The system is simple, pressing Q or E increases your speed, pressing them fast almost simultaneously increases your speed. -
What is the issue? Include screenshots / videos if possible!
Whenever I click fast, my speed always gets stuck in the 69-71 speed range, which is confusing. I know there are people who are faster than me at clicking Q and E, so if anyone better than me wants to try sprint, they’ll be stuck on the same speed as each other. It’s also not great knowing there’s a cap to the speed you want to go at. (the green text is my speed.)
https://medal.tv/games/roblox-studio/clips/msh4kLwP4AbVc_nbq?invite=cr-MSxLeHgsNDE2MzM4Njk4&v=8
- What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I’ve tried using a macro to emulate clicking very fast, but i still get stuck at 69-71.
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.Q and not gameProcessed then
humanoid.WalkSpeed = humanoid.WalkSpeed + 5
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.Q and not gameProcessed then
humanoid.WalkSpeed = humanoid.WalkSpeed - 2.35
task.wait(1.14)
humanoid.WalkSpeed = humanoid.WalkSpeed - 2.65
end
end)
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E and not gameProcessed then
humanoid.WalkSpeed = humanoid.WalkSpeed + 5
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E and not gameProcessed then
humanoid.WalkSpeed = humanoid.WalkSpeed - 2.35
task.wait(1.14)
humanoid.WalkSpeed = humanoid.WalkSpeed - 2.65
end
end)