I know this is a dumb question, but ive tryed script after script and nothing seems to even slightly work. I'm stumped.. I've got a textlabel in a frame in a screengui, and I need it to say the player's name when they have entered the game and stay there, and all I know how to do is to tag the players name after they have said something in the chat..
function onPlayerEntered(player) script.Parent.PName.Text = player.Name end game.Players.PlayerAdded:connect(onPlayerEntered)
I understand it doesn't explain who the player is but i'm confused what how to explain it.
function onPlayerEntered(player)
script.Parent.PName.Text = player.Parent.Name
end
game.Players.PlayerAdded:connect(onPlayerEntered)
I hope this will help you. This is my first time answering a question here so idk if this is the way but you just needed to add "Parent" after player
function onPlayerEntered(player) repeat wait() until player.Character script.Parent.PName.Text = player.Name end game.Players.PlayerAdded:connect(onPlayerEntered)
There is no problem with this script, but are you sure that you placed the script inside the Frame? I still added something that is waiting for the Character to exist as the player perhaps has not loaded.
There is no "Name" property inside a player. To get the name, you would have to get the name of the character object of the player. So to get the name of the player, do this:
local name = player.Character.Name
Hope this helped.
Your welcome.