As the name suggests, one would expect IsRunMode to return true ONLY when clicking the Run button in Studio. The documentation supports this assumption:
This method returns whether the Run button has been pressed to run the simulation in Studio.
…
Note that Studio only enters “run” mode when the Run button is pressed, not the Play button.
However, it also returns true on the server when using “Play”, “Play Here”, and “Local Server”. The response to a post from 2020 pointing out this incorrect behavior was that the documentation was wrong, as seen here:
If this truly is the intended behavior, the documentation should reflect this. If it’s not the intended behavior, the documentation should at least have a note about the current behavior until the behavior is fixed.
Thanks
Page URL: https://create.roblox.com/docs/reference/engine/classes/RunService#IsRunMode