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

How do I make it so that a script applies to everyone?

game.Players.LocalPlayer.CameraMaxZoomDistance = 10 <-- I've tried, this but the error keeps saying that "LocalPlayer isn't a valid member of Players" and it doesn't work.

Also, how do I make it so that text says something such as

"Hello, (fireblader7470)." But the username is changed for other people?

2 answers

✓ Accepted answer

Well first, you want to make sure that the first part is inside of a localscript, or else this won't work. If i'm correct, you just have it in a regular script? Anyways, for the second part, to make the text change it to anyone's name, just do this:

game.Players.PlayerAdded:connect(function(Plr) --Fires when a player joins the game
Name=Plr.Name --Gets the players name
script.Parent.Text="Hello, "..Name.."." --This'll change the text to say hello to anyone.
end)

Anyways, put this into a localscript that's inside the textlabel or whatever it is that welcomes the player when they join. This should work. If you have any problems or questions, please leave a comment below. Hope I helped :P

First, make sure the first script is in a localscript. Second, this how you make it say the player joined.

game.Players.PlayerAdded:connect(function(p)
    script.Parent.Text = "Welcome, "..p.Name
end)

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