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

finding a part thats a variable (EASY)?

So I'm trying to change the name of a part that's a variable but when I do the following script

local part1 = script.Parent
local part2 = game.Workspace.Baseplate
part1.Name = game.Workspace.part2.Name

it tries to find a part in workspace called part2 but I want it to find the variable. is there a way to do this by keeping it as a variable?

2 answers

✓ Accepted answer

If you have a variable for its path, you don't have to write its path ever again.

So you can just do:

local part1 = script.Parent
local part2 = game.Workspace.Baseplate
part1.Name = part2.Name

If you would like to make part1 named the same as part2.

You dont have to write all path again cause you already have path2 variable.

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