Character not getting telported

I have a part of my script but It wont teleport the player but everything after it plays

	
	if player.Data.Lives.Value == 0 then
		character.HumanoidRootPart.Position = workspace.TeleportLocations.Sentence.Position
		print("tped")
	end

Are you sure player.Data.Lives.Value = 0?

Try using character:SetPrimaryPartCFrame() it might work. Also, Like @dexanddeb said, Ensure that the Lives value is equals to 0 before testing it. You might want to run the code whenever the Lives value changes - Running it once won’t make it work.

-- Other code...
player.Data.Lives:GetPropertyChangedSignal("Value"):Connect(function()
	if player.Data.Lives.Value <= 0 then
		character:SetPrimaryPartCFrame(workspace.TeleportLocations.Sentence.CFrame)
		print("tped")
	end
end)
3 Likes

:SetPrimaryPartCFrame() is deprecated, use :PivotTo()

1 Like

I’ve encountered this same thing try using CFrame.