How to make a textbox equal a Parts Name?

local TextBox = --textbox location
local Part = --Part location

TextBox:GetPropertyChangedSignal('Text'):Connect(function()
	Part.Name = TextBox.Text
end)

I really wanna make a textbox equal to the parts name. How can I do this?

What is the problem? the code seems to be fine

Pretty much I want the text inside for the textbox to change the Part’s name.

The main issue here is that you’re changing the part’s name in a local script, so it will not replicate to the server. Set up a RemoteEvent for this interaction to work.

For example:

--// Local script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextBox = script.Parent.TextBox

TextBox:GetPropertyChangedSignal("Text"):Connect(function()
	ReplicatedStorage.RemoteEvent:FireServer(TextBox.Text)
end)
--// Server script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Part = script.Parent

ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Player,TextChange)
	Part.Name = TextChange
end)