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

how do I make my cloned object spawn in a specific position?

Asked by 6 years ago
while true do
    game.Workspace.ChickenNugget:Clone().Parent = game.Workspace
    wait(0.7)
end
0
game.Workspace.ChickenNugget.Position = Vector3.new(x, y, z) lol User#24403 69 — 6y

2 answers

Log in to vote
1
Answered by
yHasteeD 1819 Moderation Voter
6 years ago
Edited 6 years ago

For first, create a variable to clone.

And set the position with variable.Position = Vector3.new(x,y,z)

Here is the script:

while true do
    local brick = game.Workspace.ChickenNugget:Clone()
    brick.Parent = game.Workspace
    brick.Position = Vector3.new(0,0,0) -- Put the position.
    -- for set model position you can use brick:SetPrimaryPartCFrame(CFrame.new(0,0,0))
    wait(0.7)
end

-- yHasteeD --

Hope it helped :)

0
Thanks jalbraek 29 — 6y
0
How could I make the cloned parts get deleted after a certain amount of time? jalbraek 29 — 6y
1
you can use Debris. for this create another question. yHasteeD 1819 — 6y
0
jalbreak use :Destroy() after your brick to destroy it MathijsM2006 12 — 6y
1
The debris is better. you can see here: https://developer.roblox.com/api-reference/class/Debris yHasteeD 1819 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

Try doing this:

while true do
    local ChickenNuggetClone =  game.Workspace.ChickenNugget:Clone().Parent =                
         ChickenNuggetClone.Position.CFrame = CFrame.new(0,0,0) -- Put the position of the chicken nugget here


    wait(1)
end

Answer this question