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

I am trying to make the gui display the players name but the script doesnt work. any help?

Here is the script:

local player = script.Parent.Parent.Parent.Parent.Parent.Players.LocalPlayer

script.Parent.Text = player

end of script.

so basically the script picks the player that is in the server and then the script tells the text to change to that players name. but it doesn't work. let me know if you know the answer.

2 comments

0

Players = game:GetService("Players") plyr = Players.LocalPlayer

0

Do you want the text to be the players name?

4 answers

✓ Accepted answer

Hi RealJustFoxin!

To do this, you need to get the name of the player.

Something like this will do:

local player = game.Players.LocalPlayer

script.Parent.Text = player.Name

1 comment

0

Thanks for accepting!

You haven't set the name, you just wrote player, you must write player.Name also i reccomend using game.Players.LocalPlayer instead.

Hello!

This is how I would go about fixing this:

local player = game.Players.LocalPlayer

player.PlayerGui.ScreenGui.TextLabel.Text = player.Name --Change this line (before the =) to match with your gui.

Make sure this is in a localscript and you're good to go! :)

I have An Explanation Please Accept

script.Parent.Text = game:GetService("Players").LocalPlayer.Name

Easy As This :) Hope This Works

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