Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Will this script clone the model at the specific coordinates i need?

local map1 = game.ServerStorage.Map1

local function createMap1Copy () local map1Copy = map1:Clone () map1Copy.Parent = game.Workspace.Vector3.new(x, y, z)

I have to add the button to activate the script but will the above part work? Also how would I make the model anchored so It doesn't just fall to the ground? Im new to this so please bear with me, Thanks!!

1 comment

0

I dont know how to make it a script format on here sorry

1 answer

✓ Accepted answer

No. The Parent must be an object, such as Workspace.

You can however move the model somewhere using Model:SetPrimaryPartCFrame(), but in order to do that, you need to set the PrimaryPart property of the model in properties to the main part of the model.

local map = game:GetService("ServerStorage").Map1

local copy = map:Clone()
copy.Parent = workspace
copy:SetPrimaryPartCFrame(CFrame.new(x,y,z))

Alternatively, you can use a function called Model:MoveTo(), however you should use SetPrimaryPartCFrame() instead, as it's not recommended to use MoveTo().

It takes Vector3 as an argument, unlike SetPrimaryPartCFrame(), which takes a cframe, and a big downside of it is if there's not enough free space, it's going to position the model on the top of the part(s) occupying the space.

local map = game:GetService("ServerStorage").Map1

local copy = map:Clone()
copy.Parent = workspace
copy:MoveTo(Vector3.new(x,y,z))

1 comment

0

Thank you, this helps alot

This discussion is preserved as it was. New answers, comments, and votes are closed.