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

CFrame is not a valid member of Model? [Solved]

When i try to clone a model and then weld it to the player i get the error CFrame is not a valid member of Model

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Char)
		local Part = Char:WaitForChild("Head")
		local helm = game.ReplicatedStorage.Helm
		local Weld = Instance.new("WeldConstraint", Char)
		local clone = helm:Clone()
		clone.Parent = game.Workspace.PlayerGear
		clone:SetPrimaryPartCFrame(Part.CFrame) 
		Weld.Part0 = Part
		Weld.Part1 = clone.Center
	end)
end)

3 answers

✓ Accepted answer

You are trying to index the model on line 12 with the variable "clone". This won't work as "clone" is a model and models do not have a CFrame property. A hitbox basepart would be the way to go, then indexing it accordingly.

CFrame isint a property of "Model" Try setting a PrimaryPart and moving that.

2 comments

0

how would i the primary part

0

"how would i the primary part" lol

so cframe isn't a property of a model like dimondflash57 said and set the primarypart to a part in the model what this does is when you set the cframe (i will tell you how in a sec) then that part will go to that cframe and all the other parts in the model will follow like if before it was to the right of the primary part then after it will still be to the right ok now how to do it in the script so its pretty easy all you have to do is:

model:SetPrimaryPartCFrame()--CFrame goes here

hope this helped! tell me if i forgot anything

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