I want to get these functions to run at the same time if needed how can I do that?

I want to get these functions to run at the same time if needed.
They work fine when the keys are pressed individually.

The problem comes in when you press another key before the previous key finishes its cooldown. When you press a key it does the ability and keeps updating the gui size till the power is ready again.

But if you press another key before the previously pressed key cools down it glitches the previously pressed key and the previous key gui never updates or finished the cooldown.

how can i get the previous key to finish updating its cooldown gui while running the code from the different key press

The script is pretty large so ill just put the main stuff below.


UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Space then

elseif input.KeyCode == Enum.KeyCode.E and Can_Dash == true then

elseif input.KeyCode == Enum.KeyCode.RightShift and SpecialMoveReady == true then

end
end)

Seems like your piece of code does not contain any problem, it’d be helpful if you post the entire code here

Your explanation and question are very vague, however, from what little I can understand, perhaps you should detect when a key is released, in UserInputService.InputEnded.

1 Like

spawn(Yourfunction) lets you run a function without yielding the script.

2 Likes

It seems that coroutine is more suitable than spawn:

3 Likes