Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't scripts work in Studio if they are moved or created in Play?

For example, I have a script sitting in Lighting waiting to be cloned and ran in workspace, but when it is cloned, the script does nothing.

I can disable and re-enable it, cut and paste it, all for nothing. The scripts are like deadweight. For some reason, though, the scripts will run in Run mode - just not Play or Play here. Any idea why?

Even inserting a new script doesn't print "Hello World!"

This is preventing me from testing, so if this is intended, I will have to figure out a different way - maybe instead of cloning, enabling the script that is already there.

Thanks for reading.

4 comments

0

Maybe clone the script to the... game.Workspace...?

2

Store scripts in ServerScriptService not lighting. What kind of script is it....make sure when the script is sitting in storage that it is disabled.

2

If It's a Event leave it in ("ServerScriptService"), not lighting.. Lighting isn't a suitable storage as it was back in 2013..

0

It's a loop for animating a hovercar that should only be running if the car is running - so I will leave it in the car disabled by default, I think. Thank you for the answers!

1 answer

✓ Accepted answer

When you test the game using Play, the "Game Testing Mode" is on Client, not Server. So when you enable or disable Scripts from Client, move anything, etc, it doesn't actually do anything on the server. There is a button to switch to Server mode, and any changes you make there will actually work and replicate to all players.

More on Game Testing Mode

Lighting is also not a suitable place to store Scripts and other things that only the Server should be able to see, because Clients have access to all the instances stored there. Use ServerStorage instead.

1 comment

0

Thanks for the insight! I'll try to test everything in Server mode then!

This discussion is preserved as it was. New answers, comments, and votes are closed.