I was trying to generate player’s private room by generating “room model” on different positions.
i tried it with using model:SetPrimaryPartCFrame(CFrame), but my code didnt worked, so i just removed it.
local vault = game.ReplicatedStorage.Things
game.Players.PlayerAdded:Connect(function(player)
local folder = Instance.new("Folder")
folder.Name = player.UserId .."Folder"
folder.Parent = workspace.PrivateBuilding
local vault1 = vault:Clone()
vault1.Parent = folder
for _, Child in pairs(vault1:GetChildren()) do
Child.Parent = vault1.Parent --Move the children up one parent
end
vault1:Destroy()
end)
game.Players.PlayerRemoving:Connect(function(player)
local folder = workspace.PrivateBuilding:FindFirstChild(player.UserId .. "Folder")
if folder then
folder:Destroy()
end
end)
can someone help me do it?