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

How to make a players username show on a gui?

Asked by 5 years ago

I made a GUI that covers the whole screen and i want it to say Hello (Player username here), but I don't know how to I've searched on the internet on how to do it but, I still can't find how to do it pls help.

2 answers

Log in to vote
0
Answered by 5 years ago

You get the name of the LocalPlayer, then add that to your GUI's text

Example:

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

label.Text = "Hello, "..player.Name
0
When i did i got this error Players.BlueFlash2020.PlayerGui.Message.TextLabel.LocalScript:6: attempt to call field 'Name' (a string value) BlueFlash2020 5 — 5y
1
Nevermind i fixed thx for the help BlueFlash2020 5 — 5y
Ad
Log in to vote
0
Answered by 3 years ago

try this add a LOCAL script into the text label then write this script.Parent.Text = "write something here " .. game.Players.localPlayer.Name .. "write something here if you want"

Answer this question