Here is my problem the code below works perfectly but I noticed that if the q key is pressed twice very quickly the fuel of my jetpack stops descending but I continue to fly which makes the system break.
Hey Blague_Defense!
Looking over it once, I’m seeing this as a possibility.
You’re running this event’s code multiple times, so you’re getting a true and false back to back. Disconnect from set Fuel Timer going to the branch and that might be what fixes things!
I tested your solution but it does not solve my problem in fact I think I saw the problem in fact when I press my key once and stay there press the fuel goes down well but if I release and press the key again while staying press it the fuel no longer descends but I continue to fly I do not see what causes the sudden stop of the fuel descent in my code if you have an idea could share it with me
You need to put your JetPack Active condition check immediately after Press and Release.
On Press: If (JetPack Active) == False → Set TRUE → Do some flying
On Release: If (JetPack Active) == TRUE → Set FALSE → Do some falling
edit…
Don’t forget to clear any active timers on release.
Additionally for Multiplayer You want the server to go through the exact same logic flow so it makes its own determinations as to whether you can use the jetpack.
So…
Input Press: switch has Auth(remote) → run your conditional logic (Is it being used already, can I use it?) → Do the action → RPC Server.
Srv Activate JetPack [Run on Server] → Same conditional logic → Do the Action
Input release: Same procedures.