I'm making the part in a story game where you teleport to a vehicle when you touch a wall and I'm trying to use CFrame to teleport players but it keeps erroring
(This is a LocalScript inside of StarterPlayerScripts)
local Player = game:WaitForChild("Players").LocalPlayer game.Workspace:WaitForChild("InsideContent") game.Workspace:WaitForChild("Transportation") game.Workspace.Transportation:WaitForChild("LeftSet") game.Workspace.Transportation.LeftSet:WaitForChild("VanLeft") game.Workspace.Transportation.LeftSet.VanLeft:WaitForChild("Seating") local TP = game.Workspace.InsideContent.TPWallLeft Player.CharacterAdded:Connect(function(char) local HRP = Player.Character:WaitForChild("HumanoidRootPart") TP.Touched:Connect(function(tpactive) local CFrame1 = CFrame.new(game.Workspace.Transportation.LeftSet.VanLeft.Seating.LeftChair1.LeftSeat1) local CFrame2 = CFrame.new(game.Workspace.Transportation.LeftSet.VanLeft.Seating.LeftChair2.LeftSeat2) local SeatNum = math.random(1,2) if SeatNum == 1 then HRP.CFrame = CFrame1 elseif SeatNum == 2 then HRP.CFrame = CFrame2 end end) end)
You need to put a Vector3 value, not an instance. To get the Vector3 Position of the Seats, you add .Position to the end
game.Workspace.Transportation.LeftSet.VanLeft.Seating.LeftChair1.LeftSeat1.Position game.Workspace.Transportation.LeftSet.VanLeft.Seating.LeftChair2.LeftSeat2.Position