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

?Can someone fix my :Clone() script, the parts won't clone!

I tried to make a code where it would clone a part, then move it to a desired location. There was no error message whatsoever so it must of worked, but it wasn't what I had in mind. I will leave a script below so you can (maybe) update it. This won't seem to work. Why?

wait(10)
local Spawner1 = game.Workspace.Spawner1
local Spawner2 = game.Workspace.Spawner2
local Spawner3 = game.Workspace.Spawner3
local Spawner4 = game.Workspace.Spawner4
wait(1)
local SpawnedFromSpawner1 = Spawner1:Clone()
local SpawnedFromSpawner2 = Spawner2:Clone()
local SpawnedFromSpawner3 = Spawner3:Clone()
local SpawnedFromSpawner4 = Spawner4:Clone()
wait(1)
local SpawnedFromSpawner1 = game.Workspace.Spawner1
local SpawnedFromSpawner2 = game.Workspace.Spawner2
local SpawnedFromSpawner3 = game.Workspace.Spawner3
local SpawnedFromSpawner4 = game.Workspace.Spawner4
wait(1)
SpawnedFromSpawner1.Position = Vector3.new(4, 12.5, -6)
SpawnedFromSpawner2.Position = Vector3.new(9, 12.5, -6)
SpawnedFromSpawner3.Position = Vector3.new(14, 12.5, -6)
SpawnedFromSpawner4.Position = Vector3.new(19, 12.5, -6)
wait(1)
print("IT WORKED!!!!!")

7 comments

0

The "?" at the start of the title was just so it actually let me post this question

0

Also, how do you do the code box

0

The special box that code goes in so that it doesn't look like a gigantic jumble of words

0

Click the lua icon

0

?

0

What does lua look like? Its a thing not an icon and if it had one, what is it? (link to google image maybe)

0

Nevermind!

1 answer

First of all u should always give names to ur clones as they can be mistaken for something else and another prob is you have to use CFrame to specify the position and not Vector3, Vector is just used to specify the size The fixed script:

wait(10)
local Spawner1 = game.Workspace.Spawner1
local Spawner2 = game.Workspace.Spawner2
local Spawner3 = game.Workspace.Spawner3
local Spawner4 = game.Workspace.Spawner4
wait(1)
local SpawnedFromSpawner1 = Spawner1:Clone()
SpawnedFromSpawner1.Name = "Clone1"
local SpawnedFromSpawner2 = Spawner2:Clone()
SpawnedFromSpawner2.Name = "Clone2"
local SpawnedFromSpawner3 = Spawner3:Clone() -- give different names to them
SpawnedFromSpawner3.Name = "Clone3"
local SpawnedFromSpawner4 = Spawner4:Clone()
SpawnedFromSpawner4.Name = "Clone4"
wait(1)
local Cloney1 = game.Workspace.Clone1
local Cloney2 = game.Workspace.Clone2 -- different variable names as they can also be confused
local Cloney3 = game.Workspace.Clone3
local Cloney4 = game.Workspace.Clone4
wait(1)
Cloney1.CFrame = CFrame.new(4, 12.5, -6) -- use cframe not vector
Cloney2.CFrame = CFrame.new(9, 12.5, -6)
Cloney3.CFrame = CFrame.new(14, 12.5, -6)
Cloney4.CFrame = CFrame.new(19, 12.5, -6)
wait(1)
print("IT WORKED!!!!!")

2 comments

0

Vector is just used to specify the size. what? Vector3 is used to do Size and Position. its just a point in Space. CFrame is used for Positioning and Rotation

0

oh

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