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

How do I find the name of the Player?

Asked by 4 years ago

I am trying to find a player (from workspace), and:

1) I already made a string value in players 2) do I use a local script or a normal script

Thanks for the Help!

2 answers

Log in to vote
1
Answered by
lolzmac 207 Moderation Voter
4 years ago
Edited 4 years ago

You can use :FindFirstChild() from either a Local Script or a regular Script to get the character with the corresponding name, but you can only make changes to them on the server with a regular Script (without going through filtering enabled). For example, from a regular Script,

--If you want the character from Workspace
local Char = game.Workspace:FindFirstChild(PlayerName)
Char:Destroy()

--If you want the player from Players
local Player = game.Players:FindFirstChild(PlayerName)
Player:Kick()
0
I actually need the player name from the "Players" file awesomemode14 68 — 4y
0
Then you would do the same thing, except instead of game.Workspace:FindFirstChild(PlayerName), do game.Players:FindFirstChild(PlayerName). You can then do something like Player:Kick() lolzmac 207 — 4y
0
what if I wanted to find a one player out of two players? awesomemode14 68 — 4y
Ad
Log in to vote
0
Answered by
3wdo 198
4 years ago

i'm not sure if you mean you need a script or what kind of script but im just going by what i think you mean it needs a local script

Answer this question