so I made this
`local username = game.Players.LocalPlayer.Name
script.Parent.Text = "Hello, ('"..username"')."
`
and it doesn't seem to be working
so I made this
`local username = game.Players.LocalPlayer.Name
script.Parent.Text = "Hello, ('"..username"')."
`
and it doesn't seem to be working
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.."')."
Thanks!
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.