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

Change name by one when duplicated?

For example, there is a part that is named: "Part(1)". When duplicated, it should change the number in the brackets by one. So when "Part(1)" is duplicated it would be named "Part(2)", and so on.

Is there a setting for this?

1 comment

0

No, but probably through through the use of a plugin

2 answers

Hello,

This is a very easy script so I'm gonna explain it!

If the script works I'd appreciate you accepting my answer!

Create a part and put it in ReplicatedStorage!

Script in ServerScriptService (Not a LocalScript and not a ModuleScript)

local replicatedStorage = game:GetService("ReplicatedStorage") -- Create a variable to easily get the ReplicatedStorage

local part = replicatedStorage:FindFirstChild("Part") -- Create a variable to easily get the part

local partAmount = 0 -- Create a Variable to count the amount of parts!

while wait(1) do -- This will run every second
	
	partAmount += 1 -- Add 1 to the part amount
	
	local newPart = part:Clone() -- Clone the part
	newPart.Name = "Part"..partAmount -- Name the part "Part" plus the amount of parts (The name of the part would be Part1)
	newPart.Parent = workspace -- Put the parts parent to workspace
	
end

hey you! have you ever heard of enes? if you are in trouble, better call enes!

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