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

How would I make a name add up over and over?

I am trying to make a script for my admin commands so when I continue spawning something, it adds +1 to the end of the name so the look doesn't everlay the same part..

I tried


p.Name = p.Name + p.Name .. "1"--and that did not work

I know this is simple, I just don't remember how to do it xD

2 answers

Count them

If you have a count of how many you've spawned, it's really simple. Take this nearly-code stub:

function spawn(object)
  newObject = object:Clone()
  newObject.Name = newObject.Name .. tostring(count)
  newObject.Parent = workspace
  count = count+1
end
p.Name = p.Name .. p.Name .. "1"

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