Hi, I am currently working on the movement system for my game. I’m doing this with a combination of impulses and linear forces. The movement system works perfectly, however, when a player holds the windows exit button (The X button), the local scripts seem to continue running, but they take the players data from when they began to hold X. This means systems I have in place like a slow deceleration or roll, continue doing their logic and never end until the x has stopped being pressed.
I think it’s because of the paused frames and the movement systems are taking that as low fps, thus speeding up the player for fair gameplay. How about first detecting if their fps is <= 0.1, then if it is, pause the movement system? Something like very low fps like this may get exploited sometimes by people that uses the tab key, similar to Slap Battles (However, I think this one is a bit more different).
Does your movement system run on RenderStepped? If so, does it have the delta input taken? (game:GetService("RunService").RenderStepped:Connect(function(delta) end)). If it does, then you can very well measure the player’s frame rate. If the delta spiked over a certain threshold, then you can pause the movement system.
Try something like:
local threshold = 0.5 --try adjusting this
local prevDelta = 0
game:GetService("RunService").RenderStepped:Connect(function(delta)
if (delta - prevDelta) < threshold then
--continue
else
--pause
end
prevDelta = delta --this should be at the very end
end)