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)

2 comments
Thank you! You helped me solve the last bit of a very long line of errors I'd been facing for days
:D