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

CFrame/Vector3 not a valid member of Part?

I am creating a script that is placed inside a part (Red Neon Cylinder) that tells it that if a player touches it, it moves to a different location, but I get an error saying that CFrame is not a valid member of Part. It did the same thing when I tried changing the CFrame into a Vector3. Here is my script:

function onTouched(part)
local part = script.Parent
part.Cframe = CFrame.new(part.Position.X, 1.8, part.Position.Z)
wait(0.1)
part.CFrame = CFrame.new(math.random(-118.75, -81.25), 2.25, math.random(100.25, 62.75)) --Makes it teleport to a different location within a certain area
end
script.Parent.Touched:connect(onTouched)

This script is a modified version of a kill brick script by the way.

1 answer

✓ Accepted answer

Oh, I caught your mistake. I used to make this mistake alot too.

CFrames must be spelled "CFrame"

For one of them, you typed "Cframe" (lowercase f)

2 comments

0

Thank you I overlooked my spelling error. It works now.

0

Your Welcome

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