Telporting causing player to die

When I teleport a player, they get teleported, then just immediately die…?

--// Enter the mine
local function EnterMine(hit)
	local Character = hit.Parent
	if not Character then return end
	
	local TouchedPlayer = Players:GetPlayerFromCharacter(Character)
	if not TouchedPlayer then return end
	
	if Debounce then return end
	
	Debounce = true
		
	Entrance.PrimaryPart.CanCollide = false
	Exit.PrimaryPart.CanCollide = false

	Character:SetPrimaryPartCFrame(Exit.WalkIn.CFrame) -- Teleport player
end

ezgif.com-gif-maker (48)

1 Like

Is this underground? If so have you set your destroy parts range respectively?

Reference

3 Likes

It looks like a NAN error the way the character dissapear.

Otherwise try setting the humanoid root part CFrame instead of using set primary part CFrame instead. Just a guess to see if set primary part is the one causing the issue.

Edit: NVM, never would have thought @IEnforce_Lawz solution pretty interesting

1 Like