Could anyone tell me where I went wrong?
function onTouched(part) local h = part.Parent:findFirstChild("Torso") if (h ~=nil) then h.CFrame = script.Parent.Parent.Parent.Part1.Position.CFrame end end script.Parent.Touched:connect(onTouched)
Thetacah you were close, however you have to use CFrame.new, and you tried to CFrame the humanoid instance:
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h ~= nil then t = h.Parent.Torso t.CFrame = CFrame.new(script.Parent.Parent.Parent.Part1.Position) end end --Keep in mind that the player will go inside of that part, but if you want to get the player on top of it you can PM my ROBLOX script.Parent.Touched:connect(onTouched)
Where you went wrong was you put Position.CFrame, where the only sub-properties of Position are X, Y, and Z.
I don't use CFrame to often, but I think this should work.
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h ~=nil then h.CFrame = script.Parent.Parent.Parent.Part1.Position end end script.Parent.Touched:connect(onTouched)
If you want to move the player to the part do this.
function onTouched(part) local h = part.Parent:findFirstChild("Torso") if (h ~=nil) then h.CFrame =CFrame.new(script.Parent.Parent.Parent.Part1.CFrame.x,script.Parent.Parent.Parent.Part1.Position.y+3,script.Parent.Parent.Parent.Part1.Position.z) end end script.Parent.Touched:connect(onTouched)