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

a textlabel puts the name of the localplayer?

so I made this

`local username = game.Players.LocalPlayer.Name

script.Parent.Text = "Hello, ('"..username"')."

`

and it doesn't seem to be working

3 answers

✓ Accepted answer

You did a very simple mistake. You forgot the two dots ('..') in the end of the word 'username'. The correct way is:

local username = game.Players.LocalPlayer.Name
script.Parent.Text = "Hello, ('"..username.."')."

Make sure it's a Local Script and if it is use the script below:

local Username = game.Players.LocalPlayer
local TextLabel = script.Parent.TextLabel

TextLabel.Text = "Hello, ('"..Username.Name.."')

-- If you want to filter the text:

local TextService = game:GetService("TextService")
local filteredTextResult = TextService:FilterStringAsync(text, fromPlayerId)

TextLabel.Text = "Hello, ('"..Username.Name.."')

https://developer.roblox.com/en-us/articles/Text-and-Chat-Filtering -- More info about filtering.

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