Hello, I am currently developing a base system and having issues with it.
Every player in my game has their own base and I want to replace these bases when their owner leaves the game. However, when I try to replace the old base with the new one, the bases CFrame doesn’t set properly.
Here is my script:
Players.PlayerRemoving:Connect(function(player)
-- REPLACING BASE
wait(3)
local storedBase = ServerStorage:WaitForChild("Base")
local playerBase = bases:FindFirstChild(tostring(player.UserId))
local cloneBase = storedBase:Clone()
cloneBase:PivotTo(playerBase:WaitForChild("Slots"):WaitForChild("MainPart").CFrame) -- This line is causing the issue
playerBase:Destroy()
cloneBase.Parent = workspace:WaitForChild("Bases")
end)
Try maybe changing PivotTo to MoveTo then task.wait() and later set clonebase.primarypart.orientation to your desired orientation,
And also if the model parts have the CanCollide enabled, the model will naturally generate above of the thing that is there,
I basically used another part and gave it the bases position and orientation. After that, I set the new bases CFrame to that parts CFrame. Everything works fine now.