Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 5 years ago

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.

0
Maybe clone the script to the... game.Workspace...? Xapelize 2658 — 5y
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. ForeverBrown 356 — 5y
2
If It's a Event leave it in ("ServerScriptService"), not lighting.. Lighting isn't a suitable storage as it was back in 2013.. menofmen1234 20 — 5y
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! Drak0Master 172 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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.

0
Thanks for the insight! I'll try to test everything in Server mode then! Drak0Master 172 — 5y
Ad

Answer this question