How to Get Player.Name to work

Hey There! I’m trying to get this TextLabel’s Script to say the players name when there’s a text animation.

I’ve tried Player.name and now all it says is that code “Do you know where you are Player.Name?” It won’t say the players name.

I followed Alvinbox’s tutorial to make a typewriter text animation, because I want the type writer text animation

Here the Script:

local textLabel = script.Parent:WaitForChild(“Text”)

wait(1)

local function typewrite(object,text,length)

for i = 1,#text, 1 do

object.Text = string.sub(text,1,i)

wait(length)

end

end

typewrite(textLabel, “Do you know where you are player.name?”,0.05) – Time

Heres the Image’s

You need to combine strings.

Example:

local Message = "This players name is "..Player.Name.."!"
2 Likes

player.name is in the string block.

Try this instead:

"Do you know where you are" .. player.name .. "?"
2 Likes

Thanks I’m testing the code write now.

Thank you this really Helped! I’ve been try for so long but this worked!
Thank You!