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

How do I give a cloned model a position?

the script i made below clones a model that looks like money and is supposed to give it a position to the spawn part of where it should clone to but it clones to the points (0,0,0)

local position = Vector3.new(script.Parent.Parent.Spawn.Position)

script.Parent.ClickDetector.MouseClick:Connect(function()
	local newMon = game.ReplicatedStorage.Money:Clone()
	newMon.Parent = workspace
	newMon:SetPrimaryPartCFrame(CFrame.new(position))
end)

3 comments

0

To be clear, is this a local or global script?

0

global

0

Alright, thanks, I'll look at it a bit.

1 answer

✓ Accepted answer

A Part's Position property returns a Vector3, so basically on the first line you are converting a Vector3 to a Vector3, and it results in the coordinates (0, 0, 0).

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