Hi! i can't make an teleport to an building from a part (part is position where the teleport target)
code:
for i = 1,#elevatorlobbyplayers do
local char2 = game.Workspace:FindFirstChild(elevatorlobbyplayers)
local HMR3 = char2:FindFirstChild("HumanoidRootPart")
if HMR3 then
HMR3.CFrame = CFrame.new(elevator.TeleportPart.Position)
end
end
the code is piece of code where the error
EDIT: i alerady fixed it by adding into players a tag and detecting it

4 comments
Which line is giving the error
When finding the HMR3
At line 3
Char2 is nil.