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

How do I make a TextLabel ScreenGUI say the name of the player in the game?

Here's what I have tried to do so far:

``local Players = game:GetService("Players") local Players = Players.LocalPlayer print(Players) script.Parent.Parent.Parent.BackstoryGUI.BackstoryText.Text = Players

The print check works and it says my name when I run the code. However, I get an error that says that it was expecting a string instead of an instance but im not really sure what that means or how to fix it. Is there a way I could do this?

1 answer

Hi, you've forgotten ".Name" so it will return an instance.

local Player = game:GetService("Players").LocalPlayer.Name
script.Parent.Parent.Parent.BackstoryGUI.BackstoryText.Text = Player

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