script.Parent.Gas.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
Hit.Parent:MoveTo(script.Parent.Teleporter.Position)
end
end)
https://gyazo.com/ed1012dc08f06a3cbae5a6c9800da5e4 It spawns on top of those black things at the top. I want the player to teleport inside the red thing when they get teleported. How do I make it so it does not teleport the player on top?
For anyone wondering, here is the working code:
script.Parent.Gas.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
Hit.Parent:SetPrimaryPartCFrame(CFrame.new(script.Parent.Teleporter.Position))
end
end)

5 comments
Within the model add a part called teleport position and cet the CFrame/Position to that
I did, it won't work. It is even under the map. And it teleports on top.
If you change using Position then the part will be put on top of the other part if there is no room. Swap to set CFrame using https://developer.roblox.com/api-reference/function/Model/SetPrimaryPartCFrame
Alright, it works now. Thank you.
MoveTo will automatically place you above the object