Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How To Change Characters Name Through Script?

Anybody who plays Party.exe will get what I mean. You know how in explorer you can name an NPC and the name will show above it in studio, and in game? I can't figure out how to make him talk through the name, I don't know how to change the name through script. Can anybody help me out? I want to use the name appearing above him as a way of having him talk, in my opinion it looks better than those dialog bubbles studio offers. If you want I can provide a link to the game. I just need their names to be able to change for awhile as a form of talking. https://web.roblox.com/games/4790319571/Work-exe?refPageId=904328cd-e0f9-4034-a44d-304aade2a47e

3 comments

0

If you do think of an answer, please simplify it, i'm very new to coding.

0

you can access and change a model's name by doing MODEL.Name

0

Also, the name appears above the head if the model contains a Humanoid and a part named "Head".

4 answers

Simple, just do .Name like so

script.Parent.MouseButton1Click:Connecr(function()
	Whatever.the.character.is.Name = NewName -- this could be localplayer, but u need to reference it from the local side if it is
end)

Change the function from a click to whatever u want, idk if this works but try it

1 comment

0

by the way not trying to bust but when you put in connect you accidentally put an r so original player just replace the connecr with connect

local character = workspace:FindFirstChild("CharacterName") -- INSERT CHARACTER NAME HERE

local text = {"INSERT TEXT HERE"}
local WAIT_TILL_DEFAULT_NAME = {2} -- How long you want to wait after the text has been completed for it to return to the character's original name
local ORIGINAL_CHARACTER_NAME = {"John Doe"} -- What was your characters original name, the reason being ^

-- Insert whatever function you want that will trigger this, be sure to add a end) at the end of the script-paragraph depending if it's a loop or a function
-- I will add a while loop to satisfy my OCD
while true do
    for i = 1, #text do
        character.Name = string.sub(text, 1, i)
        wait(0.04)
    end
    wait(WAIT_TILL_DEFAULT_NAME[1])
    character.Name = ORIGINAL_CHARACTER_NAME[1]
end

4 comments

0

My answer made the name go like a typewriter, animated text.

0

Where do I put this script?

0

In serverscriptservice.

0

I edited the script, made a mistake 16h's ago

First of all create a normal script, then insert the following


game.Players.PlayerAdded:Connect(function(player) -- Does something when a player joins.
	
	player.Name = "Insert the name :D" -- Player.Name is basically the name of the player!
end)

I know this has got nothing with your answer to do but you can also change other things of the player, Forinstance


game.Players.PlayerAdded:Connect(function(player)
	
	print(player.AccountAge)
	
	if player.AccountAge == 2006 then
		print("You are a roblox veteran")
	end
end)

And other cool things.

If there are any errors please re-comment

This discussion is preserved as it was. New answers, comments, and votes are closed.