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

How would I detect a player's name and have it in a GUI?

Asked by 9 years ago

So after typing this script, I tested it and realized I needed to add the player name to the script. How would I be able to detect the player name and have it above the rank I have implemented above the player's head.

01groupid = 2830422
02 
03game.Players.PlayerAdded:connect(onPlayerRespawned)
04function onPlayerRespawned(newPlayer)
05    wait(1)
06    if newPlayer:IsInGroup(groupid) then
07        local gui = Instance.new("BillboardGui")
08        gui.Parent=newPlayer.Character.Head
09        gui.Adornee=newPlayer.Character.Head
10        gui.Size=UDim2.new(2,0,.78,0)
11        gui.StudsOffset=Vector3.new(0,2,0)
12        local texta=Instance.new("TextBox")
13        texta.Size=UDim2.new(1,0,1,0)
14        texta.BackgroundTransparency = 1
15        texta.BackgroundColor3 = Color3.new(0, 0, 0)
View all 46 lines...
0
if newPlayer:IsInGroup(groupid) and newPlayer.Character.Head:FindFirstChild'BillboardGui' == nil then User#9949 0 — 9y
0
What line would I add that to? BunnyFilms1 297 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Just use

1PlayerName = NewPlayer.Name

It's as simple as that.

Ad

Answer this question