How do you script a text that has the players name

This is the script that should have the players name, and im struggling
my code:

local t = {
	"Hello there,"; -- this would say Hello there, player name.
}

return t

You can put in a placeholder like
“Hello there, %s”

and then string.format the string to replace the %s

how’d do i do that, i barely know how to script

Is it a Local Script?

If so, just fetch the LocalPlayer and use string concatenation to implement it in the string

Example:

local player = game:GetService("Players").LocalPlayer

local t = {
  `Hello there, {player.Name}`
}

return t

No its not a local script. its a module, this is the full code:

local t = {
	"Hello there,";
	"It seems you've been caught in here as well.";
	"You might not remember how you got here... None of them did.";
	"They call this hellhole the 'Backrooms'";
	"It's likely you got here the same way we did:";
	"You clipped through a wall or glitched in here, like a movie, or a video game.";
	"I left these tapes behind in hopes that survivors like you can find their way when they get lost.";
	"But be careful,";
	"If you really, want to survive you'll have to listen to a survivor out there,";
	"There are monsters in here. Don't let them toy with you.";
	"And don't die...",
	--"Good luck..."
}

return t

Ill go check if it would work, thanks for the help.

1 Like

robloxapp-20230829-1653156.wmv, thanks it works

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.