I was having some issues with scripts earlier, the problem seemed to be this line of code:
game.Players.LocalPlayer
I was wondering if "game.Players.LocalPlayer" was functional in a normal script.
(The script ended up working when I copied it into a LocalScript)
Normal "Script" objects are run by the server; that means it doesn't have a notion of one particular player being "special", so it can't pick the LocalPlayer.
In Test Solo, Scripts will identify the LocalPlayer -- it's unambiguous, since there can only be one. I think this is done so that there is not a need to simulate two separate copies of the world when testing.
Running with a Test Server will actually separate the behavior of LocalScripts from normal Scripts.
Summary No, you can't: LocalPlayer
should only be used in LocalScripts -- otherwise it will be nil
(except when testing, so be careful).
game.Player.LocalPlayer Can only be used in A Local Script Because Regular Script can not declare a LocalPlayer Only A Local Script Would Define The "Local Player"