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 fix the problem I'm having with a CFrame Function?

So here is what I have: function checkforblock(x,y) if workspace:FindFirstChild(x) == nil then local ree = Instance.new("Part", workspace) ree.Name = (x) ree.Anchored = true if workspace:FindFirstChild(y) == nil then local Y = Instance.new("Part", workspace) Y.Name = (y) Y.Anchored = true end end end

function position(x, y, z, a) local newCFrame = CFrame.new(x, y, z) local object = (a) object.CFrame = newCFrame end

checkforblock("Redblock","blueCube") position(0, 5, 0, "Redblock")

My mess up is in the third line of the position function. It gives me the error of ("Error attempt to index local 'object' (a string value)") I can't figure out why, Could I have some help please.

1 answer

✓ Accepted answer

the property of CFrame is Vector3 so it should be like Vector3.new()

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