What should be cloned(in replicatedStorage)
And the result(In workspace)
As you can see, Parts dont load in after being cloned using :Clone().However, Models load in.
The script that clones the parts(is a moduleScript under ReplicatedFirst)
local Map = {}
local MapsFolder = game:GetService("ReplicatedStorage").Maps
function Map.Load(MapName)
print("Loading")
local CurrentMap = MapsFolder:FindFirstChild(MapName):Clone()
CurrentMap.Parent = workspace
local camPart = MapsFolder:FindFirstChild(MapName):WaitForChild("Others"):WaitForChild("CamPart"):Clone()
camPart.Parent = CurrentMap:WaitForChild("Others")
print("Loaded")
local players = game:GetService("Players")
for i, v in pairs(players:GetPlayers()) do
print("getting players")
local spawnpoint = Random.new():NextInteger(1, 11)
print("gettingspawns")
local spawns = CurrentMap:WaitForChild("TeleportParts"):GetChildren()
local char = v.Character or v.CharacterAdded:Wait()
char.PrimaryPart.Anchored = true
game.ReplicatedStorage.Events.MapStart1:FireAllClients(CurrentMap)
print("spawning")
return true
end
end
return Map
And Here is the Script(ServerScript under StarterGui)
local Mapui = script.Parent
local startEvent = game.ReplicatedStorage.Events.MapStart
local changeEvent = game.ReplicatedStorage.Events.MapChange
local maptable = {
"Danzig"
}
local namelabel = Mapui.Parent.NAME
local DateLabel = Mapui.Parent.DATE
local tweenService = game:GetService("TweenService")
local map = require(game.ReplicatedFirst.Modules.MapManager)
print("variables loaded")
startEvent.OnServerEvent:Connect(function(player, ID)
if maptable[ID] == "Danzig" then
print("done")
script.INTRO.TimePosition = 1
script.INTRO:Play()
Mapui.Parent.Visible = true
task.wait(2)
local tween1 = tweenService:Create(Mapui, TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 9000,0, 7000)})
local tween2 = tweenService:Create(Mapui, TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Position = UDim2.new(-3.278, 0,-3.928, 0)})
task.wait(1)
tween1:Play()
tween2:Play()
task.wait(1)
namelabel.Text = "Danzig"
DateLabel.Text = "1939"
namelabel.Visible = true
task.wait(2)
DateLabel.Visible = true
tween2.Completed:Connect(function()
local tween = tweenService:Create(Mapui.Parent.Blank, TweenInfo.new(1), {BackgroundTransparency = 0})
tween:Play()
local sound = tweenService:Create(script.INTRO, TweenInfo.new(3), {Volume = 0})
sound:Play()
tween.Completed:Connect(function()
for i, v in pairs(Mapui.Parent:GetChildren()) do
if v:IsA("ImageLabel") or v:IsA("TextLabel") then
v.Visible = false
end
end
local tweenout = tweenService:Create(Mapui.Parent.Blank, TweenInfo.new(0.5), {BackgroundTransparency = 1})
local isdone = map.Load("Danzig")
tweenout:Play()
if isdone then
game.ReplicatedStorage.Sounds.DANZIGTHEME:Play()
end
end)
end)
end
end)
Thank you if you can help.

