Testing your roblox game in the studio acts differently than actually playing it outside of the studio

From the Roblox Developer Forum:

Hi, this is a very simple-to-fix issue.

You must go to the View Section on Roblox Studio and then click drafts, there you’ll see all the scripts you have made changes to. Right-click and click "commit" to commit the changes and then you should publish to Roblox. This will fix your issue.

Uncommitted scripts do not work outside of studio.

Therefore it is not website glitches or coding typos in your case.