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.

2 comments
Thank you I overlooked my spelling error. It works now.
Your Welcome