How do I make it so a part has the players name on it.
Like on a surface gui then a textlabel?
Kind of like how GASA4 did it
(I know this is probably simple I’m just really confused.)
(I know this is probably simple I’m just really confused.)
you can put a script under the textlabel and write:
local Character = script:FindFirstAncestorWhichIsA("Model")
if Character then
script.Parent.Text = Character.Name
end
i put the script under a text label and it didnt work
yeah its a server script and inside of my startercharacter but the surface gui is inside a part also in the torso
do i remove the part?
can i see a image for reference?
is that part welded to the torso? otherwise it would fall straight off
yeah i welded it using moon animator and it didnt fall off
uhh, try putting it straight in the torso
wait actually, can i see inside your script, i copied the picture you sent and it still works for me
and what does the text say when you play?
Server script inside of game.StarterPlayer.StarterCharacterScripts
:
script.Parent:FindFirstChildWhichIsA('TextLabel').Text = script.Parent.Name
If you want to have multiple TextLabels, just use direct paths. If your character name is different from the player’s name, path to the player and use that name instead.
You’ll likely want to path to the TextLabel anyway using WaitForChild() in order to wait for it to exist in the first place.
Or if you want to be lazy:
local character = script.Parent
local textLabel
while not textLabel do
textLabel = character:FindFirstChildWhichIsA('TextLabel')
end
textLabel.Text = character.Name
i set the text in the properties hi
but when i play the game it remains hi meaning it probably doesnt work
No, you were right, I didn’t read correctly.
sorry for a kind of late response but it works thank you so much!!
Yeah, so it seems that scripts get removed from the StarterCharacter of which aren’t default scripts. Really weird behavior on Roblox’s part.
Dang I didn’t realize that, thanks for the help.