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

Random CFrame Error That I Cannot Understand For My Dance Floor Script, Help?

for _,add in next,(Row:GetChildren()) do
		table.insert(tab,add.CFrame)
	end
-- Much Later in the script
for wow = 1,#tab do
		for ind,k in next,(Row:GetChildren()) do
		k.CFrame = k.CFrame * CFrame.new(tab[wow])
		table.remove(tab,ind)
		end

I also tried...

for wow = 1,#tab do
		for ind,k in next,(Row:GetChildren()) do
		k.CFrame = CFrame.new(tab[wow])
		table.remove(tab,ind)
		end

The error is really what stumps me. Both of them get it. Tab is a table that contains the CFrame of the part I am trying to change this it to.

Workspace.Floor.Script:74: bad argument #1 to 'new' (Vector3 expected, got CFrame)

The jist of what I am trying to do is save multiple parts' CFrames into a table to reset them after they undergo much change of their position in the world.

1 comment

0

the error is on line 74; change the "CFrame.New()" to "Vector3.New()" on line 74

1 answer

The error really answers your question. Replace CFrame.new() to Vector3.new() like this!

k.CFrame = K.CFrame * Vector3.new(tab[wow])

1 comment

0

Basic logic.

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