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

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

Asked by 9 years ago

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

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
9 years ago

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

Ad
Log in to vote
0
Answered by
Relatch 550 Moderation Voter
9 years ago

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)

Answer this question