local TeleportService = game:GetService("TeleportService") local elevatorpos = script.Parent.Elevator.Union.Attachment.Position local function yield() for i=15, 0, -1 do end end local function tp(otherpart) if not otherpart.Parent:FindFirstChild("Humanoid") then return end otherpart.Parent.HumanoidRootPart.CFrame = CFrame.new(elevatorpos) print(elevatorpos, "attachment") print(otherpart.Parent.HumanoidRootPart.Position) end script.Parent.Hitbox.Union.Touched:Connect(tp)
For some reason the player keeps getting teleported to what seems to be the origin (0,0,0) Even though when I print the position it should be correct. This is all from a serverscript inside a model inside workspace
otherpart.Parent
should be the Player's Character model. If so, then you can use:
otherpart.Parent:MoveTo(elevatorpos.CFrame) or otherpart.Parent:MoveTo(elevatorpos)
You should have another part where the player teleports to not just put the location where the player teleports to.
Here is an example of one that I have made:
My Model