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

Is there a way to shorten this? [solved]

Asked by 9 years ago
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.

0
Is this in a local script? traigla 75 — 9y
0
No, because I took this part out of a HUGE script that is a regular script. (was not a free modeled script) PyccknnXakep 1225 — 9y
0
LocalPlayer only works in a local script. traigla 75 — 9y
0
Oh but would it affect my whole regular script? PyccknnXakep 1225 — 9y
0
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. Ryzox 220 — 9y

Answer this question