function game.ReplicatedStorage.RemoteFunctions.ReviveAnimation.OnClientInvoke(f,R)local s=player.Character.Torso.CFrame for Z=1,#f.Head,1 do if R~=nil then if player.Character.Torso.Position.Z>R then break end end;(game:GetService("\082\117\110\083\101\114\118\105\099\101")).RenderStepped:wait()for f,R in pairs(f)do if player.Character:FindFirstChild(f)then if R[Z]then player.Character[f].CFrame=R[Z]end end end s=player.Character.Torso.CFrame end player.Character:Destroy()return s end
--Playing the revive animation locally works a lot better than playing it server side
function game.ReplicatedStorage.RemoteFunctions.ReviveAnimation.OnClientInvoke(bodyPartsLocationTable, lastBranch)
	local respawnPosition = player.Character.Torso.CFrame
	for i = 1, #bodyPartsLocationTable["Head"] do
		if lastBranch ~= nil then
			if player.Character.Torso.Position.Z > lastBranch then
				break
			end
		end
		game:GetService("RunService").RenderStepped:wait()
		for key, value in pairs(bodyPartsLocationTable) do
			if player.Character:FindFirstChild(key) then
				if value[i] then
					player.Character[key].CFrame = value[i]
				end
			end
		end
		respawnPosition = player.Character.Torso.CFrame
	end
	player.Character:Destroy()
	return respawnPosition
end
