local Change = game.Players.LocalPlayer.PlayerGui.Gui.Frame.Maintext
Change.Text = "Testing"
Whenever I try to fit all that stuff in one variable, it gives me the error Cannot get LocalPlayer or something like that. It's annoying so I have to use the whole thing, which is pretty long. Any help? Thanks.

5 comments
Is this in a local script?
No, because I took this part out of a HUGE script that is a regular script. (was not a free modeled script)
LocalPlayer only works in a local script.
Oh but would it affect my whole regular script?
I don't understand why you are even attempting to get localplayer from a server script .-. you can get players in different ways, eg using PlayerAdded or searching for them in game.Players so you don't HAVE to make it local, you could use an alternative method of getting player.