Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I rename an Instance when its spawned?!

Asked by 10 years ago

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()

0
Doesn't work :l FaisalRules 0 — 10y

2 answers

Log in to vote
3
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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"
Ad
Log in to vote
-2
Answered by 10 years ago

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

Answer this question