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

How do I rename an Instance when its spawned?!

I have this script but how would I make it so I can make multiple spawn locations. I would need to rename the next one right? How would I do that?

Spawn = Instance.new("SpawnLocation", game.Workspace) game.Workspace.SpawnLocation.Anchored = true game.Workspace.SpawnLocation.Transparency = .9 game.Workspace.SpawnLocation.CanCollide = false

game.Workspace.SpawnLocation.Position = Vector3.new(-148.3, 0.9, 187.9)

wait(.1)

game.Workspace.SpawnLocation:Remove()

1 comment

0

Doesn't work :l

2 answers

You created a variable Spawn in your script, but for some reason you aren't using it.

All of the lines you have could be made much shorter:

Spawn.Anchored = true
Spawn.Transparency = .9
Spawn.CanCollide = false

etc.


There's a Name property that you can edit which is a string (text). Strings are denoted by double or single quotes, e.g.

Spawn.Name = "ANewName"

Spawn.Name = "noob" or don't name them just Spawn1 = Instance.new("SpawnLocation", game.Workspace) bla bla bla

Spawn2 = Instance.new("SpawnLocation", game.Workspace) bla bla bla Spawn2:destroy()

im noob dont hate

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