-
I currently have a system that clones a part to a location.
-
However when changing the part to a Model it Clones it but doesn’t change the CFrame.
-
I have the PrimaryPart set aswell
(ENTIRE SCRIPT) LOCATED IN “ServerScriptService” V
local dFac = game:GetService("ReplicatedStorage"):WaitForChild("Factories").DefaultFactory
local part = game:GetService("Workspace"):WaitForChild("Part")
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("FactoryDS")
local Players = game:GetService("Players")
local Nodes = game:GetService("Workspace"):WaitForChild("Locations")
Players.PlayerAdded:Connect(function(player)
local factoryLoaded = false
for _, location in Nodes:GetChildren() do
if not location:FindFirstChild("DefaultFactory") then
if factoryLoaded then break end
local success, data = pcall(function()
return DataStore:GetAsync(tostring(player.UserId))
end)
if success and data and data["OwnedFactory"] then
local LoadFac = dFac:Clone()
LoadFac.Parent = workspace
LoadFac.CFrame = location.CFrame
LoadFac.Name = tostring(player.UserId)
factoryLoaded = true
print("FactoryPerPlayerLoaded")
end
end
end
end)
(RELEVANT PART OF SCRIPT) V
local dFac = game:GetService("ReplicatedStorage"):WaitForChild("Factories").DefaultFactory
local LoadFac = dFac:Clone()
LoadFac.Parent = workspace
LoadFac.CFrame = location.CFrame
LoadFac.Name = tostring(player.UserId)
factoryLoaded = true