So I just want a code to join two parts like this:
But the code its always changing its position and rotation, making it to look like this:
Heres the code:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local modelsStage1 = ReplicatedStorage:WaitForChild("Stage1")
--First Stage
task.wait(2)
local function chooseModelStage1()
local models = modelsStage1:GetChildren()
if #models == 0 then
warn("Error1")
return nil
end
local randomIndex = math.random(1, #models)
return models[randomIndex]
end
local stage1 = chooseModelStage1()
if stage1 then
local clone = stage1:Clone()
local startPos = game.Workspace.StartingSpot.EndHelper:GetPivot()
clone.Parent = game.Workspace
clone:SetPrimaryPartCFrame(startPos)
end