I am making a 2D platformer game, I have nailed the control and camera, I just need help with the teleport lava (Lava that TP's you to start) scripts. Currently I have this
function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then -- Because object "hit" is just "Left Leg" or "Right Leg"
game.Workspace.???.Torso.CFrame = CFrame.new(Vector3.new(-43, 10, 13))
end
end
script.Parent.Touched:connect(onTouched)
The ??? is what I am stuck on. I need help on identifying a certain Instance by Name, not ClassName.

3 comments
so this? game.Worksapce[hit.Parent].Torso.CFrame = CFrame.new(Vector3.new(-43, 10, 13))
@lucas. When i replace with that, i recieve "Workspace.Part.Script:4: bad argument #2 to '?' (string expected, got Object)"
[hit.Parent.Name]* not [hit.Parent]